﻿:root {
    --bg0: #0b1020;
    --bg1: #0f1730;
    --card: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .14);
    --text: rgba(255, 255, 255, .92);
    --muted: rgba(255, 255, 255, .72);
    --accent: #7c5cff;
    --accent2: #2ee9a6;
    --shadow: 0 20px 60px rgba(0, 0, 0, .45);
    --radius: 18px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg0: #f6f7fb;
        --bg1: #ffffff;
        --card: rgba(0, 0, 0, .04);
        --border: rgba(0, 0, 0, .10);
        --text: rgba(0, 0, 0, .88);
        --muted: rgba(0, 0, 0, .62);
        --shadow: 0 16px 50px rgba(18, 24, 40, .14);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100dvh;
    color: var(--text);
    font-family: 'Vazirmatn', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: radial-gradient(900px 500px at 20% 10%, rgba(124, 92, 255, .35), transparent 60%),
    radial-gradient(700px 450px at 85% 25%, rgba(46, 233, 166, .22), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.wrap {
    width: min(1100px, 100%);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

h1 {
    margin: 0;
    font-size: clamp(22px, 3vw, 32px);
    letter-spacing: .2px;
    font-weight: 700;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.search-box {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    font-family: 'Vazirmatn', sans-serif;
    transition: border-color .2s ease;
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-input::placeholder {
    color: var(--muted);
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

nav {
    padding: 8px;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

a.link {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, .06);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

a.link:hover {
    transform: translateY(-1px);
    border-color: rgba(124, 92, 255, .35);
    background: rgba(124, 92, 255, .12);
}

a.link:active {
    transform: translateY(0);
}

a.link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 92, 255, .15);
    border-radius: 12px;
    flex-shrink: 0;
}

.icon svg {
    width: 28px;
    height: 28px;
    fill: var(--accent);
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-width: 0;
}

.lang-section {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.name {
    font-weight: 600;
    letter-spacing: .15px;
    font-size: 15px;
}

.desc {
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.en {
    text-align: left;
    direction: ltr;
}

.fa {
    text-align: right;
    direction: rtl;
}

.no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

footer {
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

footer a, footer span a{
    text-decoration: none;
    color: var(--muted);
}

.kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
}

.stats-bar {
    padding: 12px 16px;
    background: rgba(124, 92, 255, .08);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.count {
    color: var(--accent2);
    font-weight: 600;
}

@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    a.link {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }
}

.hidden {
    display: none !important;
}

.theme-toggle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all .2s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(124, 92, 255, .12);
    border-color: rgba(124, 92, 255, .35);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white;
    padding: 14px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(124, 92, 255, .4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: slideUp .3s ease;
    max-width: calc(100% - 30px);
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.install-prompt-text {
    flex: 1;
    min-width: 0;
}

.install-prompt-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.install-prompt-desc {
    font-size: 13px;
    opacity: .9;
}

.install-btn {
    background: rgba(255, 255, 255, .25);
    border: 1px solid rgba(255, 255, 255, .3);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    font-size: 14px;
    transition: all .2s ease;
    white-space: nowrap;
}

.install-btn:hover {
    background: rgba(255, 255, 255, .35);
    transform: scale(1.05);
}

.close-install {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    line-height: 1;
    opacity: .8;
    transition: opacity .2s;
}

.close-install:hover {
    opacity: 1;
}

body[data-theme="light"] {
    --bg0: #f6f7fb;
    --bg1: #ffffff;
    --card: rgba(0, 0, 0, .06);
    --border: rgba(0, 0, 0, .18);
    --text: rgba(0, 0, 0, .88);
    --muted: rgba(0, 0, 0, .62);
    --shadow: 0 16px 50px rgba(18, 24, 40, .14);
}

body[data-theme="light"] a.link {
    background: rgba(124, 92, 255, .04);
    border: 1px solid rgba(0, 0, 0, .12);
}

body[data-theme="light"] a.link:hover {
    background: rgba(124, 92, 255, .12);
    border-color: rgba(124, 92, 255, .45);
    box-shadow: 0 4px 12px rgba(124, 92, 255, .15);
}

body[data-theme="light"] .icon {
    background: rgba(124, 92, 255, .12);
    border: 1px solid rgba(124, 92, 255, .2);
}

body[data-theme="light"] .stats-bar {
    background: rgba(124, 92, 255, .06);
    border-bottom: 1px solid rgba(0, 0, 0, .12);
}

body[data-theme="light"] .card {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(20px);
}

body[data-theme="dark"] {
    --bg0: #0b1020;
    --bg1: #0f1730;
    --card: rgba(255, 255, 255, .08);
    --border: rgba(255, 255, 255, .14);
    --text: rgba(255, 255, 255, .92);
    --muted: rgba(255, 255, 255, .72);
    --shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

/* Update Notification Styles */
.update-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    z-index: 1000;
    width: min(500px, calc(100% - 32px));
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.update-notification.hidden {
    display: block;
}

.update-content {
    background: linear-gradient(135deg, var(--accent) 0%, #9b7fff 100%);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: 0 12px 40px rgba(124, 92, 255, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    color: white;
}

.update-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.update-text {
    flex: 1;
}

.update-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.update-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.95;
    line-height: 1.4;
}

.update-button {
    background: white;
    color: var(--accent);
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.update-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.update-button:active {
    transform: scale(0.98);
}

.dismiss-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

.dismiss-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
    .update-content {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    
    .update-icon {
        font-size: 48px;
    }
    
    .update-button {
        width: 100%;
    }
    
    .dismiss-button {
        top: 12px;
        right: 12px;
    }
}

