/* ========================================
   اسمك - موقع صور الأسماء المصممة بالذكاء الاصطناعي
   ملف CSS شامل - Dark Mode + Responsive
   ======================================== */

:root {
    /* الألوان - الوضع الليلي (الافتراضي) */
    --primary: #03dac6;
    --primary-dark: #02b8a8;
    --primary-light: rgba(3, 218, 198, 0.1);
    --bg: #121212;
    --surface: #1e1e1e;
    --surface-light: #2a2a2a;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --border: #333;
    --border-light: #444;
    --error: #cf6679;
    --success: #03dac6;
    --warning: #ffb74d;
    
    /* الأبعاد */
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
    
    /* الخطوط */
    --font-main: 'Tajawal', sans-serif;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header & Navigation
   ======================================== */
.site-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    flex-shrink: 0;
}

.logo span {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.logo a:hover span {
    color: var(--primary-dark);
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.header-search {
    flex-shrink: 0;
}

.header-search .search-form {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    width: 280px;
    transition: var(--transition);
}

.header-search .search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-search .search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 14px;
    outline: none;
    color: var(--text);
    font-family: inherit;
}

.header-search .search-form input::placeholder {
    color: var(--text-muted);
}

.header-search .search-form button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    padding: 4px;
    transition: var(--transition);
}

.header-search .search-form button:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary);
    font-weight: 800;
}

.hero-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-box {
    max-width: 500px;
    margin: 30px auto 0;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 100;
}

.search-results a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.search-results a:hover {
    background: var(--surface-light);
    color: var(--primary);
}

.search-results a:last-child {
    border-bottom: none;
}

/* ========================================
   Sections
   ======================================== */
.section {
    padding: 50px 0;
}

.section-alt {
    background: var(--surface);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-right: 4px solid var(--primary);
    padding-right: 15px;
    font-weight: 700;
}

/* ========================================
   Image Grid (Masonry)
   ======================================== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* ========================================
   Image Cards
   ======================================== */
.image-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    break-inside: avoid;
}

.image-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--bg);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.image-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.image-info {
    padding: 12px;
    text-align: center;
}

.image-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Names Grid
   ======================================== */
.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.name-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.name-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.name-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
}

.name-info {
    padding: 10px;
    text-align: center;
}

.name-info h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 5px;
    color: var(--text);
}

.name-info span {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   Single Image Page
   ======================================== */
.single-image-page {
    padding: 40px 0;
}

.breadcrumb {
    margin-bottom: 25px;
    color: var(--text-muted);
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb span {
    margin: 0 8px;
}

.image-presentation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.image-wrapper-single {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.image-wrapper-single img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-wrapper h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.info-wrapper p {
    color: var(--text-muted);
    line-height: 1.8;
}

.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-download,
.btn-share {
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
}

.btn-download {
    background: var(--primary);
    color: #000;
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-share {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-share:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    background: var(--bg);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.tag-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
    
    .main-nav ul {
        gap: 15px;
    }
    
    .header-search .search-form {
        width: 250px;
    }
    
    .image-presentation {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav {
        order: 2;
    }
    
    .header-search {
        order: 3;
        width: 100%;
    }
    
    .header-search .search-form {
        width: 100%;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--surface);
        padding: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .names-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .hero-section,
    .page-header {
        padding: 40px 15px;
    }
    
    .hero-section h1,
    .page-header h1 {
        font-size: 1.6rem;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-download,
    .btn-share {
        width: 100%;
        text-align: center;
    }
    
    .image-presentation {
        padding: 15px;
    }
    
    .info-wrapper h1 {
        font-size: 1.5rem;
    }
}

/* ========================================
   Loading States
   ======================================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-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;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* ========================================
   إظهار وصف الصورة على مرحلتين (مخفي ← مختصر ← كامل)
   ======================================== */
.desc-toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px 2px;
    margin-top: -6px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.desc-toggle:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.desc-toggle-icon {
    font-size: 13px;
    line-height: 1;
    transition: transform 0.25s ease;
}

.desc-toggle[aria-expanded="true"] .desc-toggle-icon {
    transform: rotate(180deg);
}

.desc-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
