/* ============================================
   صُورة - تصميم موقع الصور والفيديوهات
   ============================================ */

/* المتغيرات */
:root {
    /* الألوان الأساسية */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    
    /* الألوان المميزة */
    --accent-primary: #ff6b35;
    --accent-secondary: #f7c94b;
    --accent-gradient: linear-gradient(135deg, #ff6b35 0%, #f7c94b 100%);
    --accent-glow: 0 0 40px rgba(255, 107, 53, 0.3);
    
    /* ألوان النص */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    
    /* ألوان الحدود */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    
    /* الظلال */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    
    /* الأبعاد */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    /* الحركة */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* إعادة التعيين */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Kufi Arabic', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* الخلفية المتحركة */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(247, 201, 75, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 107, 53, 0.04) 0%, transparent 70%);
    animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}

/* الحاوية */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   الهيدر
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-btn.active {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    box-shadow: var(--accent-glow);
}

.api-key-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.api-key-btn svg {
    width: 20px;
    height: 20px;
}

.api-key-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ============================================
   قسم البحث الرئيسي
   ============================================ */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-title {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #a0a0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* نموذج البحث */
.search-form {
    max-width: 700px;
    margin: 0 auto 32px;
}

.search-wrapper {
    display: flex;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.search-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--accent-glow), var(--shadow-lg);
}

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

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

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 32px;
    border: none;
    background: var(--accent-gradient);
    color: var(--bg-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.search-btn svg {
    width: 22px;
    height: 22px;
}

.search-btn:hover {
    filter: brightness(1.1);
}

.search-btn:active {
    transform: scale(0.98);
}

/* الاقتراحات */
.suggestions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.suggestions-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tag {
    padding: 8px 18px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tag:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

/* ============================================
   قسم النتائج
   ============================================ */
.main {
    padding: 40px 0 80px;
    min-height: 50vh;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.results-title span {
    color: var(--accent-primary);
    font-weight: 700;
}

.results-count {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* حالة التحميل */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-secondary);
}

.loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.loader-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: var(--accent-secondary);
    animation-duration: 1s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-top-color: var(--text-secondary);
    animation-duration: 0.8s;
}

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

/* رسائل الخطأ */
.error-message,
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.error-message svg,
.no-results svg {
    width: 80px;
    height: 80px;
    color: var(--accent-primary);
    margin-bottom: 24px;
    opacity: 0.8;
}

.error-message p,
.no-results h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.retry-btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: var(--bg-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: var(--transition-fast);
}

.retry-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* ============================================
   شبكة العرض (Masonry)
   ============================================ */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    grid-auto-flow: dense;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition-normal);
}

.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: 1;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition-slow);
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.05);
}

/* أحجام مختلفة للعناصر */
.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

/* معلومات العنصر */
.item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-normal);
}

.gallery-item:hover .item-info {
    opacity: 1;
    transform: translateY(0);
}

.item-photographer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.item-photographer svg {
    width: 18px;
    height: 18px;
}

/* أيقونة الفيديو */
.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 107, 53, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: var(--transition-normal);
}

.video-indicator svg {
    width: 24px;
    height: 24px;
    color: white;
    margin-right: -3px;
}

.gallery-item:hover .video-indicator {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-height: 250px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   زر تحميل المزيد
   ============================================ */
.load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.load-more-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.load-more-btn svg {
    width: 20px;
    height: 20px;
}

.load-more-btn:hover {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--accent-glow);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   نافذة العرض (Lightbox)
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px;
    opacity: 0;
    transition: var(--transition-normal);
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lightbox-close:hover {
    background: var(--accent-primary);
    transform: rotate(90deg);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-info {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-card);
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.photographer {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.photographer svg {
    width: 20px;
    height: 20px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-gradient);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition-fast);
}

.download-btn svg {
    width: 18px;
    height: 18px;
}

.download-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* عناصر التحكم في Lightbox */
.lightbox-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* اختيار جودة الفيديو */
.video-quality-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-quality-selector label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* اختيار مقاس الصورة */
.photo-size-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.photo-size-selector label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.quality-select {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 180px;
}

.quality-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.quality-select:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.quality-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* ============================================
   الفوتر
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.footer a:hover {
    color: var(--accent-secondary);
}

.copyright {
    margin-top: 8px;
    font-size: 0.85rem !important;
}

/* ============================================
   استجابة الشاشات
   ============================================ */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 16px;
    }
    
    .hero {
        padding: 50px 0 40px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .search-wrapper {
        flex-direction: column;
    }
    
    .search-btn {
        justify-content: center;
        padding: 16px;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .gallery-item.wide {
        grid-column: span 1;
    }
    
    .lightbox {
        padding: 20px;
    }
    
    .lightbox-info {
        flex-direction: column;
        gap: 12px;
        padding: 12px 20px;
        width: calc(100% - 40px);
    }
    
    .lightbox-controls {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    
    .video-quality-selector {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .photo-size-selector {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .quality-select {
        width: 100%;
        min-width: auto;
    }
    
    .results-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .nav-btn span {
        display: none;
    }
    
    .nav-btn {
        padding: 12px 16px;
    }
    
    .tag {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
    
    .gallery {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .gallery-item.tall {
        grid-row: span 1;
    }
}

/* ============================================
   تأثيرات إضافية
   ============================================ */
/* تأثير التمرير للعناصر */
.gallery-item {
    animation: fadeInUp 0.5s ease backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تأثير النبض للأزرار */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(255, 107, 53, 0); }
}

.search-btn:focus {
    animation: pulse 1.5s infinite;
}

/* شريط التمرير */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================
   نافذة API Key
   ============================================ */
.api-key-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.api-key-btn svg {
    width: 20px;
    height: 20px;
}

.api-key-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.api-key-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: var(--transition-normal);
}

.api-key-modal.active {
    display: flex;
    opacity: 1;
}

.api-key-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.api-key-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    z-index: 10;
}

.api-key-close svg {
    width: 20px;
    height: 20px;
}

.api-key-close:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: rotate(90deg);
}

.api-key-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border-color);
}

.api-key-header svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.api-key-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.api-key-body {
    padding: 24px 32px 32px;
}

.api-key-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.api-key-description a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.api-key-description a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.api-key-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-key-input-wrapper {
    position: relative;
}

.api-key-input-wrapper label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.api-key-input {
    width: 100%;
    padding: 14px 50px 14px 18px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
}

.api-key-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.api-key-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    margin-top: 12px;
}

.api-key-toggle:hover {
    color: var(--accent-primary);
}

.api-key-toggle svg {
    width: 20px;
    height: 20px;
}

.api-key-status {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 10px;
}

.api-key-status.show {
    display: flex;
}

.api-key-status.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.api-key-status.error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.api-key-status.loading {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.api-key-status svg {
    width: 18px;
    height: 18px;
}

.api-key-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.api-key-save-btn,
.api-key-test-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.api-key-save-btn {
    background: var(--accent-gradient);
    color: var(--bg-primary);
}

.api-key-save-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--accent-glow);
}

.api-key-test-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
}

.api-key-test-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.api-key-save-btn svg,
.api-key-test-btn svg {
    width: 18px;
    height: 18px;
}

.api-key-save-btn:disabled,
.api-key-test-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .api-key-modal-content {
        max-width: 100%;
        margin: 0;
    }
    
    .api-key-header {
        padding: 24px 24px 20px;
    }
    
    .api-key-header h2 {
        font-size: 1.25rem;
    }
    
    .api-key-body {
        padding: 20px 24px 24px;
    }
    
    .api-key-actions {
        flex-direction: column;
    }
    
    .api-key-save-btn,
    .api-key-test-btn {
        width: 100%;
    }
}

