:root {
    /* Enhanced High-Contrast Color Palette */
    --primary-teal: #0891B2;  /* Darker for better contrast */
    --primary-green: #059669;  /* Darker green */
    --primary-blue: #2563EB;  /* Stronger blue */
    --primary-sky: #0284C7;
    --primary-mint: #10B981;
    
    /* Darker shades for text and accents */
    --dark-teal: #0E7490;
    --dark-green: #047857;
    --dark-blue: #1D4ED8;
    --dark-sky: #0369A1;
    
    /* Light backgrounds - slightly more contrast */
    --light-teal: #F0FDFA;
    --light-green: #F0FDF4;
    --light-blue: #EFF6FF;
    --light-gray: #FAFAFA;
    
    /* Text colors - Enhanced contrast */
    --text-primary: #111827;  /* Darker for better readability */
    --text-secondary: #374151;  /* Darker secondary */
    --text-muted: #6B7280;  /* Darker muted text */
    
    /* Borders */
    --border-light: #E2E8F0;
    --border-medium: #CBD5E1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-sky) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-mint) 100%);
    --gradient-blue: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-sky) 100%);
}

/* Reset default Bootstrap-like colors */
body {
    background: var(--light-gray);
    color: var(--text-primary);
    font-size: 16px;  /* Minimum 16px for mobile */
    line-height: 1.6;  /* Better readability */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header styling */
.header {
    background: white;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.logo {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Navigation tabs */
.nav-tab {
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.nav-tab:hover {
    background: var(--light-teal);
    border-color: var(--primary-teal);
    color: var(--dark-teal);
}

.nav-tab.active {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

/* Buttons */
.btn-primary {
    background: var(--primary-teal);  /* Solid color for better contrast */
    border: none;
    color: white;
    font-weight: 600;  /* Bolder for readability */
    transition: all 0.3s ease;
    padding: 12px 24px;  /* Larger touch targets */
    font-size: 16px;  /* Readable size */
    min-height: 44px;  /* Minimum touch target height */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--light-blue);
    border-color: var(--primary-blue);
    color: var(--dark-blue);
}

.btn-success {
    background: var(--gradient-secondary);
    border: none;
    color: white;
}

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

/* Form elements */
input, select, textarea {
    border: 2px solid #94A3B8;  /* Darker border for better contrast */
    background: #F0F9FF;  /* Light blue background */
    transition: all 0.3s ease;
    font-size: 16px;  /* Prevent zoom on mobile */
    padding: 12px 16px;  /* Larger touch targets */
    min-height: 44px;  /* Minimum touch target */
    color: #111827;  /* Dark text for contrast */
    border-radius: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input::placeholder,
textarea::placeholder {
    color: #64748B;  /* Darker placeholder text */
    opacity: 1;
}

input:focus, select:focus, textarea:focus {
    border-color: #0891B2;  /* Teal border on focus */
    background: #FFFFFF;  /* White background on focus */
    outline: none;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.05);  /* More visible focus state */
}

/* Cards */
.form-card, .name-card {
    background: white;
    border: 2px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-radius: 12px;
}

.form-card:hover, .name-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-teal);
}

/* Generator cards with categories */
.generator-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.generator-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.generator-card .card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gradient-primary);
}

.generator-card .card-emoji {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    background: var(--gradient-primary);
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-fantasy {
    background: var(--light-teal);
    color: var(--dark-teal);
}

.category-business {
    background: var(--light-blue);
    color: var(--dark-blue);
}

.category-modern {
    background: var(--light-green);
    color: var(--dark-green);
}

.category-nature {
    background: #ECFCCB;
    color: #65A30D;
}

.category-technology {
    background: #E0E7FF;
    color: #4F46E5;
}

.category-historical {
    background: #FEF3C7;
    color: #B45309;
}

/* Loading spinner */
.spinner {
    border-color: var(--primary-teal);
    border-top-color: transparent;
}

/* Toast notifications */
.toast {
    background: var(--gradient-primary);
    color: white;
}

/* Favorites section */
.favorites-section {
    background: var(--light-teal);
    border: 1px solid var(--primary-teal);
}

/* Results section */
.results-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* Variation pills */
.variation-pill {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: var(--light-blue);
    color: var(--dark-blue);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variation-pill:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.05);
}

/* Analytics dashboard */
.stat-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

/* Popular names list */
.popular-name-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 8px;
}

.popular-name-item:hover {
    background: var(--light-teal);
}

.popular-count {
    background: var(--primary-teal);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    body {
        font-size: 18px;  /* Larger base font for mobile */
    }
    
    .generator-card .card-image,
    .generator-card .card-emoji {
        height: 150px;
    }
    
    .generator-card .card-emoji {
        font-size: 48px;
    }
    
    /* Better spacing for mobile */
    .form-card, .name-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    /* Larger buttons on mobile */
    .btn-primary, .btn-secondary, .btn-success {
        font-size: 18px;
        padding: 14px 28px;
        min-height: 48px;
    }
    
    /* Better text hierarchy */
    h1 { font-size: 28px; }
    h2 { font-size: 24px; }
    h3 { font-size: 20px; }
    h4 { font-size: 18px; }
    
    /* Improved spacing */
    p, li {
        line-height: 1.7;
        margin-bottom: 16px;
    }
}

/* Theme Toggle Button */
#themeToggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 0;
}

#themeToggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    background: var(--light-teal);
}

#themeToggle:active {
    transform: scale(0.95);
}

#themeToggle img {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Dark mode adjustments */
body.dark-mode #themeToggle {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode #themeToggle:hover {
    background: #374151;
}

/* PWA Install Button - position it higher to avoid stacking */
#pwaInstallBtn {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #10b981; /* Green background */
    border: 2px solid #059669;
    box-shadow: var(--shadow-md);
    display: none; /* Hidden until install prompt available */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 0;
}

#pwaInstallBtn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    background: #86efac; /* Light green hover */
}

#pwaInstallBtn img {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #themeToggle {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    #themeToggle img {
        width: 16px;
        height: 16px;
    }

    #pwaInstallBtn {
        bottom: 60px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    #pwaInstallBtn img {
        width: 16px;
        height: 16px;
    }
}