/*
Theme Name: WebOS
Theme URI: https://example.com/webos
Author: Your Name
Author URI: https://example.com
Description: یک قالب شبیه سیستم عامل با ظاهر گلس مورفیسم، SPA و Ajax با htmx. ورژن پیشرفته با پشتیبانی از iframe برای محتوا و مدیریت پنجره‌های تکراری.
Version: 2.0.0
License: GPL v2 or later
Text Domain: webos
*/

@font-face {
    font-family: 'Yekan';
    src: url('https://cdn.fontcdn.ir/Font/Persian/Yekan/Yekan.eot');
    src: url('https://cdn.fontcdn.ir/Font/Persian/Yekan/Yekan.eot?#iefix') format('embedded-opentype'),
         url('https://cdn.fontcdn.ir/Font/Persian/Yekan/Yekan.woff2') format('woff2'),
         url('https://cdn.fontcdn.ir/Font/Persian/Yekan/Yekan.woff') format('woff'),
         url('https://cdn.fontcdn.ir/Font/Persian/Yekan/Yekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Yekan', Tahoma, Arial, sans-serif;
    background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover no-repeat fixed;
    height: 100vh;
    overflow: hidden;
    color: #fff;
    direction: rtl;
}

.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    font-size: 1.4rem;
    color: white;
}

.circle:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.3);
}

#header {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 500;
}

#header > * {
    pointer-events: auto;
}

#logo {
    padding: 10px 32px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

#main {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 90px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

#search-container {
    width: 700px;
    max-width: 90%;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 20px 35px;
    font-size: 1.3rem;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 70px;
    color: white;
    font-family: 'Yekan', Tahoma, Arial, sans-serif;
    outline: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

#search-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(20, 20, 30, 0.4);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 40px;
    padding: 25px;
    color: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: block;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) transparent;
}

#search-dropdown::-webkit-scrollbar {
    width: 6px;
}
#search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 10px;
}

.result-section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.95);
    padding-right: 8px;
    border-right: 4px solid #fff3;
    font-weight: 500;
}

.cards-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.5) transparent;
}

.cards-row::-webkit-scrollbar {
    height: 5px;
}
.cards-row::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
}

.card {
    min-width: 150px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 28px;
    padding: 18px 12px;
    text-align: center;
    color: white;
    transition: transform 0.2s;
    font-size: 1rem;
}

.card i {
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.25);
}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.link-item {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: background 0.2s;
    font-size: 1rem;
    cursor: pointer;
}

.link-item i {
    font-size: 1.4rem;
    width: 30px;
    text-align: center;
}

.link-item:hover {
    background: rgba(255,255,255,0.22);
}

#taskbar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.45);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 70px;
    padding: 12px 24px;
    display: flex;
    gap: 22px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 600;
    direction: ltr;
}

.taskbar-icon {
    width: 58px;
    height: 58px;
    border-radius: 35%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.taskbar-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

.taskbar-icon.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: #fff;
    box-shadow: 0 0 15px #fff5;
}

#windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.window {
    position: absolute;
    width: 420px;
    height: 320px;
    background: rgba(30, 30, 40, 0.5);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    color: white;
    pointer-events: auto;
    transition: box-shadow 0.2s;
    will-change: transform;
}

.window:active {
    box-shadow: 0 25px 70px rgba(0,0,0,0.7);
}

.window-header {
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    cursor: grab;
    font-weight: 500;
    font-size: 1.1rem;
}

.window-header:active {
    cursor: grabbing;
}

.window-controls {
    display: flex;
    gap: 12px;
}

.window-controls span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.window-controls span:hover {
    opacity: 0.8;
}

.close { background: #ff5f57; }
.minimize { background: #febc2e; }
.maximize { background: #28c840; }

.window-content {
    padding: 18px;
    flex: 1;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
}

.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    border-radius: 12px;
}

.window-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.85);
    color: #111;
    padding: 6px 18px;
    border-radius: 40px;
    font-size: 0.95rem;
    border: 1px solid #333;
    margin-bottom: 12px;
    font-weight: 500;
}

.modal {
    position: fixed;
    background: rgba(25, 25, 35, 0.7);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 32px;
    padding: 22px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    color: white;
    z-index: 2000;
    display: none;
    width: 280px;
}

#account-modal {
    top: 85px;
    right: 20px;
}

#apps-modal {
    top: 85px;
    left: 20px;
    width: 320px;
}

.wallet-card {
    background: rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 18px;
    margin: 15px 0;
    border: 1px solid rgba(255,255,255,0.25);
}

.wallet-card div:first-child {
    font-size: 1rem;
    opacity: 0.9;
}

.wallet-card div:last-child {
    font-size: 1.4rem;
    font-weight: bold;
    margin-top: 5px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 15px;
}

.app-icon {
    background: rgba(255,255,255,0.12);
    border-radius: 22px;
    padding: 14px 5px;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
    font-size: 0.9rem;
}

.app-icon i {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 6px;
}

.app-icon:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.static-page-content, .custom-content {
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 30px;
    color: #fff;
}

/* لودر */
.window-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 420px;
    height: 320px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.2);
    position: absolute;
    top: 100px;
    left: 100px;
    pointer-events: none;
    z-index: 999;
}

.loader {
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}