/* CSS Variables for Catppuccin Mocha theme - high contrast */
:root {
    --highlight-1: #f38ba8; /* Catppuccin Mocha red */
    --highlight-2: #fab387; /* Catppuccin Mocha peach */
    --highlight-3: #f9e2af; /* Catppuccin Mocha yellow */
    --highlight-4: #a6e3a1; /* Catppuccin Mocha green */
    --highlight-5: #94e2d5; /* Catppuccin Mocha teal */
    --highlight-6: #89b4fa; /* Catppuccin Mocha blue */
    --highlight-7: #b4befe; /* Catppuccin Mocha lavender */
    --highlight-8: #f5c2e7; /* Catppuccin Mocha pink */
    --bg-color: #1e1e2e;    /* Catppuccin Mocha base - dark background */
    --text-color: #cdd6f4;  /* Catppuccin Mocha text - light text */
    --card-bg: #313244;    /* Catppuccin Mocha surface0 - card backgrounds */
    --border-color: #45475a; /* Catppuccin Mocha surface1 - borders */
}

/* Catppuccin Mocha color classes for category backgrounds */
.category-rosewater { background-color: #f5e0dc; color: #1e1e2e; }
.category-flamingo { background-color: #f2cdcd; color: #1e1e2e; }
.category-pink { background-color: #f5c2e7; color: #1e1e2e; }
.category-mauve { background-color: #cba6f7; color: #1e1e2e; }
.category-red { background-color: #f38ba8; color: #1e1e2e; }
.category-maroon { background-color: #eba0ac; color: #1e1e2e; }
.category-peach { background-color: #fab387; color: #1e1e2e; }
.category-yellow { background-color: #f9e2af; color: #1e1e2e; }
.category-green { background-color: #a6e3a1; color: #1e1e2e; }
.category-teal { background-color: #94e2d5; color: #1e1e2e; }
.category-sky { background-color: #89dceb; color: #1e1e2e; }
.category-sapphire { background-color: #74c7ec; color: #1e1e2e; }
.category-blue { background-color: #89b4fa; color: #1e1e2e; }
.category-lavender { background-color: #b4befe; color: #1e1e2e; }

/* Button styles for language toggle and home - Catppuccin Mocha */
#lang-en, #lang-de, #home-btn {
    position: relative;
    z-index: 1000; /* Ensure buttons are above other elements */
    cursor: pointer;
    user-select: none; /* Prevent text selection */
}

#lang-en {
    background-color: #f38ba8; /* Catppuccin Mocha red - active state */
    color: #1e1e2e; /* Dark text for contrast */
    border: 2px solid #f38ba8;
    transition: all 0.3s ease;
}

#lang-en:hover {
    background-color: #eba0ac; /* Lighter red on hover */
    border-color: #eba0ac;
}

#lang-de {
    background-color: #45475a; /* Catppuccin Mocha surface1 - inactive state */
    color: #cdd6f4; /* Light text */
    border: 2px solid #45475a;
    transition: all 0.3s ease;
}

#lang-de:hover {
    background-color: #585b70; /* Lighter surface on hover */
    border-color: #585b70;
}

#lang-es {
    background-color: #45475a; /* Catppuccin Mocha surface1 - inactive state */
    color: #cdd6f4; /* Light text */
    border: 2px solid #45475a;
    transition: all 0.3s ease;
}

#lang-es:hover {
    background-color: #585b70; /* Lighter surface on hover */
    border-color: #585b70;
}

#home-btn {
    background-color: #89b4fa; /* Catppuccin Mocha blue */
    color: #1e1e2e; /* Dark text for contrast */
    border: 2px solid #89b4fa;
    transition: all 0.3s ease;
}

#home-btn:hover {
    background-color: #74c7ec; /* Lighter blue on hover */
    border-color: #74c7ec;
}

#language-toggle {
    gap: 0.3rem;
}

/* Mystical app name styling */
.app-name {
    color: #f38ba8; /* Catppuccin Mocha red */
    font-style: italic;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-family: 'Noto Sans JP', serif;
}

/* Base body styling with smooth transitions */
body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* Theme overrides for specific elements - Catppuccin Mocha */
/* Note: Category cards use specific color classes, not generic styling */

.sentence-card {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.play-btn {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
}

.play-btn:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Category colors - light text for dark backgrounds */
.category-rosewater,
.category-flamingo,
.category-pink,
.category-mauve,
.category-red,
.category-maroon,
.category-peach,
.category-yellow,
.category-green,
.category-teal,
.category-sky,
.category-sapphire,
.category-blue,
.category-lavender {
    color: var(--text-color) !important;
}

/* Sentence highlights - subtle highlighting */
.sentence-highlight {
    background-color: rgba(137, 220, 235, 0.25); /* Light sky blue from Catppuccin */
    color: var(--text-color);
}

/* Category title and description */
#category-title,
#category-description {
    color: var(--text-color) !important;
}


/* Category card hover effects */
.category-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Sentence highlight styling */
.sentence-highlight {
    background-color: rgba(137, 220, 235, 0.25); /* Light sky blue from Catppuccin */
    color: #1e1e2e; /* Dark text for contrast */
    font-weight: bold; /* Bold font for emphasis */
    padding: 2px 4px;
    border-radius: 3px;
}

/* Karaoke active word styling - using Catppuccin Mocha colors */
.karaoke-active {
    background-color: #f38ba8; /* Catppuccin Mocha red */
    color: #1e1e2e; /* Dark text for readability */
    font-weight: normal; /* Normal weight */
    padding: 2px 4px; /* Standard padding */
    border-radius: 3px; /* Subtle rounding */
    transition: background-color 0.2s ease; /* Smooth color transition */
}

/* Word highlight base styling */
.word-highlight {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    margin: 0 2px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.word-highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Highlight color classes using CSS variables */
.highlight-1 { background-color: var(--highlight-1); color: #1e1e2e !important; }
.highlight-2 { background-color: var(--highlight-2); color: #1e1e2e !important; }
.highlight-3 { background-color: var(--highlight-3); color: #1e1e2e !important; }
.highlight-4 { background-color: var(--highlight-4); color: #1e1e2e !important; }
.highlight-5 { background-color: var(--highlight-5); color: #1e1e2e !important; }
.highlight-6 { background-color: var(--highlight-6); color: #1e1e2e !important; }
.highlight-7 { background-color: var(--highlight-7); color: #1e1e2e !important; }
.highlight-8 { background-color: var(--highlight-8); color: #1e1e2e !important; }

/* Progress bar container styling */
.progress-bar {
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

/* Progress fill bar styling */
.progress-fill {
    height: 100%;
    background-color: #f38ba8; /* Catppuccin Mocha red */
    width: 0%;
    transition: width 0.3s;
}

/* Mobile responsiveness optimizations */
@media (max-width: 768px) {
    /* Increase base font size for better readability on small screens */
    body {
        font-size: 16px;
    }

    /* Adjust heading sizes for mobile */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Make buttons touch-friendly with minimum 44px height and width */
    button {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
        font-size: 16px;
    }

    /* Adjust container padding for mobile */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Increase spacing between elements for better touch interaction */
    .category-card {
        margin-bottom: 16px;
    }

    /* Disable hover effects on touch devices, use active state instead */
    .category-card:hover {
        transform: none;
        box-shadow: none;
    }

    .category-card:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }

    .word-highlight:hover {
        transform: none;
        box-shadow: none;
    }

    .word-highlight:active {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .play-btn:hover {
        transform: none;
        box-shadow: none;
    }

    .play-btn:active {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    /* Ensure word highlights are readable on mobile */
    .word-highlight {
        padding: 4px 6px;
        margin: 2px;
        font-size: 16px;
    }

    /* Adjust progress bar height for mobile */
    .progress-bar {
        height: 6px;
    }

    /* Increase sentence highlight padding for better visibility */
    .sentence-highlight {
        padding: 4px 6px;
    }

    /* Ensure karaoke active word is prominent */
    .karaoke-active {
        font-size: 18px;
        padding: 4px 6px;
    }
}