/* ==========================================
   Pantone Finder - Premium Styles
   ========================================== */

:root {
    /* Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --accent-color: #667eea;
    --accent-light: #8b9cf4;
    --accent-dark: #4c5dc4;
    
    /* Background Colors */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.08);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* Effects */
    --border-glass: 1px solid rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==========================================
   Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top right, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ==========================================
   Glass Card Effect
   ========================================== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* ==========================================
   Container & Layout
   ========================================== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* ==========================================
   Header Styles
   ========================================== */
.header {
    text-align: center;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    flex-direction: column;
}

.logo-icon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    animation: logoFloat 3s ease-in-out infinite;
    margin-bottom: var(--spacing-sm);
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    animation: colorPulse 2s ease-in-out infinite;
}

.c1 { background: #E74C3C; animation-delay: 0s; }
.c2 { background: #3498DB; animation-delay: 0.5s; }
.c3 { background: #2ECC71; animation-delay: 1s; }
.c4 { background: #F39C12; animation-delay: 1.5s; }

@keyframes colorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.logo h2 {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--accent-light);
    margin: 0;
    letter-spacing: 1px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* ==========================================
   Color Input Section
   ========================================== */
.color-input-section {
    margin-bottom: var(--spacing-xl);
}

.input-card {
    padding: var(--spacing-lg);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.input-card h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.color-picker-wrapper {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.color-preview {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 10px 40px rgba(231, 76, 60, 0.4);
    position: relative;
    overflow: hidden;
}

.color-preview::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.color-preview:hover {
    transform: scale(1.05);
}

.preview-text {
    font-size: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#colorPicker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    opacity: 0;
    cursor: pointer;
}

.color-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.input-group {
    text-align: right;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', monospace;
    transition: var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.find-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: var(--transition-normal);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.find-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.find-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.3rem;
}

/* ==========================================
   Results Section
   ========================================== */
.results-section {
    margin-bottom: var(--spacing-xl);
    display: none;
}

.results-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.results-header h2 {
    font-size: 1.5rem;
}

.match-indicator {
    padding: 8px 16px;
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.4);
    border-radius: var(--radius-sm);
    color: #2ecc71;
    font-size: 0.875rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.result-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.result-color {
    height: 120px;
    position: relative;
}

.result-match {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    font-size: 0.75rem;
    color: white;
}

.result-info {
    padding: var(--spacing-sm);
}

.result-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.result-hex {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: 'Inter', monospace;
}

/* ==========================================
   Search Section
   ========================================== */
.search-section {
    margin-bottom: var(--spacing-xl);
}

.search-card {
    padding: var(--spacing-lg);
}

.search-card h2 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.search-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.search-wrapper input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: var(--transition-fast);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-btn {
    padding: 14px 28px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: var(--transition-normal);
}

.search-btn:hover {
    transform: scale(1.05);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    justify-content: center;
}

.filter-tag {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.filter-tag.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

/* ==========================================
   Library Section
   ========================================== */
.library-section {
    margin-bottom: var(--spacing-xl);
}

.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.library-header h2 {
    font-size: 1.5rem;
}

.color-count {
    padding: 8px 16px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--spacing-sm);
}

.library-item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.library-item::after {
    content: attr(data-name);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    font-size: 0.7rem;
    color: white;
    text-align: center;
    opacity: 0;
    transition: var(--transition-fast);
}

.library-item:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.library-item:hover::after {
    opacity: 1;
}

.load-more-wrapper {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.load-more-btn {
    padding: 14px 40px;
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-md);
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: var(--transition-normal);
}

.load-more-btn:hover {
    background: var(--accent-color);
    color: white;
}

/* ==========================================
   Modal Styles
   ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    max-width: 500px;
    width: 100%;
    padding: var(--spacing-lg);
    position: relative;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-color-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.modal-info {
    text-align: center;
}

.modal-info h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.modal-details {
    margin-bottom: var(--spacing-md);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    font-family: 'Inter', monospace;
    color: var(--accent-light);
}

.copy-btn {
    width: 100%;
    padding: 14px;
    background: var(--secondary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    transition: var(--transition-normal);
}

.copy-btn:hover {
    transform: scale(1.02);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
    .app-container {
        padding: var(--spacing-md);
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .color-preview {
        width: 160px;
        height: 160px;
    }

    #colorPicker {
        width: 160px;
        height: 160px;
    }

    .color-inputs {
        grid-template-columns: 1fr;
    }

    .search-wrapper {
        flex-direction: column;
    }

    .results-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Scrollbar Styles
   ========================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-light);
}

/* ==========================================
   Toast Notification
   ========================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
/* ==========================================
   Coffee Donation Section
   ========================================== */
.coffee-donation-section {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.1) 0%, rgba(155, 89, 182, 0.1) 100%);
    border-top: 2px solid rgba(230, 126, 34, 0.3);
    padding: 4rem 2rem;
    margin-top: 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.coffee-donation-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(230, 126, 34, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatCoffee 6s ease-in-out infinite;
}

@keyframes floatCoffee {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.coffee-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.coffee-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: slideInUp 0.8s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coffee-icon {
    font-size: 4rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.coffee-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #E67E22 0%, #BB86FC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.coffee-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.coffee-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #E67E22 0%, #D35400 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(230, 126, 34, 0.3);
    border: 2px solid transparent;
    cursor: pointer;
}

.coffee-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(230, 126, 34, 0.5);
    background: linear-gradient(135deg, #D35400 0%, #B8860B 100%);
}

.coffee-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(230, 126, 34, 0.4);
}

.coffee-emoji {
    font-size: 1.5rem;
    animation: rotateCoffee 3s ease-in-out infinite;
}

@keyframes rotateCoffee {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.btn-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coffee-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .coffee-donation-section {
        padding: 2.5rem 1.5rem;
        margin-top: 2.5rem;
    }

    .coffee-content h3 {
        font-size: 1.5rem;
    }

    .coffee-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .coffee-icon {
        font-size: 3rem;
    }
}