:root {
    --primary: #10B981;
    --primary-dark: #059669;
    --primary-light: #D1FAE5;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 24px;
}

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

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    min-height: 100vh;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 80px 20px 100px;
    background: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://images.unsplash.com/photo-1518531933037-91b2f5f229cc?auto=format&fit=crop&q=80') center/cover;
    opacity: 0.15;
    mix-blend-mode: overlay;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 24px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.25rem;
    color: #A7F3D0;
    margin-bottom: 48px;
    font-weight: 400;
}

.search-box {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    max-width: 600px;
    margin: 0 auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.3);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 16px 24px;
    font-size: 1.1rem;
    background: transparent;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    width: 56px;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

.category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 720px;
    margin: 22px auto 0;
}

.category-chip {
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.86);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.category-chip.active {
    background: white;
    color: var(--primary-dark);
    border-color: white;
    font-weight: 700;
}

/* Content Area */
.content {
    max-width: 1200px;
    margin: -40px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* Grid & Cards */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    cursor: pointer;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.card-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-kk {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 12px;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

.card-scientific {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 16px;
}

.card-desc {
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
}

/* Status States */
.hidden { display: none !important; }

.loading {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.no-results {
    text-align: center;
    padding: 80px 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.icon-box {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-md);
    position: relative;
    z-index: 101;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.8);
}

.modal-hero {
    height: 300px;
    width: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 40px;
}

.lang-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.lang-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.lang-section h2 {
    font-size: 2rem;
    margin-bottom: 4px;
}

.modal-meta {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-desc {
    display: block;
    width: 100%;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.zh-desc {
    text-align: justify;
    text-align-last: left;
}

.kk-text {
    display: block;
    width: 100%;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

.lang-section h2.kk-text {
    font-size: 2.25rem;
    line-height: 1.35;
}

.kk-desc {
    font-size: 1.25rem;
    line-height: 1.95;
    text-align: justify;
    text-align-last: right;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .search-box { flex-direction: column; border-radius: 16px; background: transparent; box-shadow: none; }
    .search-box input { background: var(--surface); border-radius: 16px; margin-bottom: 8px; }
    .search-box button { width: 100%; padding: 16px; border-radius: 16px; }
    .modal-info { padding: 24px; }
}
