/********************************************
 * COSMIC BAKER – STYLES
 ********************************************/

/* Default Theme Vars — Dark Cosmic to match suite */
:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --highlight-color: #a855f7;
    --button-text-color: #ffffff;
    --font-weight: bold;
    --card-bg: #1e293b;
    --card-border: rgba(168, 85, 247, 0.2);
    --teal-button-bg: #0d9488;
    --teal-button-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

body {
    font-family: "Trebuchet MS", sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
}

/* Visually Hidden */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Neon Focus Outline */
@keyframes cosmicFocus {
    0%   { outline-color: #ff00ff; }
    25%  { outline-color: #00ffff; }
    50%  { outline-color: #ffff00; }
    75%  { outline-color: #00ff00; }
    100% { outline-color: #ff00ff; }
}

:focus {
    outline: 3px solid #ff00ff;
    animation: cosmicFocus 2s infinite;
}

/********************************************
 * Header
 ********************************************/
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-color);
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid rgba(168, 85, 247, 0.4);
}

.header-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.05);
    padding: 8px 15px;
    border-radius: 30px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.control-group:hover {
    border-color: var(--highlight-color);
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.control-group label {
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-group select {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-weight: bold;
    cursor: pointer;
    outline: none;
}

.control-group option, select option {
    background: var(--bg-color);
    color: var(--text-color);
}

#voice-search-btn {
    background: var(--teal-button-bg);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--teal-button-shadow);
    transition: transform 0.2s ease;
}

#voice-search-btn:hover {
    transform: scale(1.05);
}

/********************************************
 * Main Container
 ********************************************/
#app-container {
    max-width: 900px;
    margin: 20px auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.hidden {
    display: none;
}

/********************************************
 * Filters
 ********************************************/
#filters {
    margin-bottom: 20px;
}

#filters select,
#filters button {
    margin: 5px;
    padding: 5px 10px;
    font-size: 14px;
}

#apply-filters-btn {
    background: var(--highlight-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/********************************************
 * Recipe Selection
 ********************************************/
.recipe-selection button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 15px;
    font-size: 16px;
    background: var(--highlight-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.recipe-selection button:hover {
    opacity: 0.9;
}

/********************************************
 * Recipe Card
 ********************************************/
.recipe-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}

.recipe-card h2 {
    margin-top: 0;
}

.recipe-image {
    max-width: 100%;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    margin-bottom: 15px;
}

.card-section {
    margin-bottom: 10px;
    border-left: 4px solid var(--highlight-color);
    padding-left: 10px;
}

.card-section h3 {
    margin-top: 0;
}

.card-section p,
.card-section ul,
.card-section ol {
    margin: 5px 0;
}

.card-section ul,
.card-section ol {
    margin-left: 20px;
}

/********************************************
 * Times
 ********************************************/
#recipe-times p {
    margin: 3px 0;
    font-weight: bold;
}

/********************************************
 * Cosmic Lesson
 ********************************************/
#stem-lesson {
    margin-top: 15px;
    border-left: 4px solid #7f00ff;
    padding-left: 10px;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
}

#stem-lesson h3 {
    margin-top: 0;
    font-weight: bold;
    color: var(--text-color);
}

/********************************************
 * Navigation Buttons
 ********************************************/
.navigation-buttons {
    margin-top: 20px;
    text-align: center;
}

.navigation-buttons button {
    padding: 10px 20px;
    font-size: 16px;
    margin: 5px 5px;
    border: none;
    border-radius: 4px;
    background: var(--highlight-color);
    color: var(--button-text-color);
    cursor: pointer;
}

.navigation-buttons button:hover {
    opacity: 0.9;
}

/********************************************
 * Theme Variations
 ********************************************/
.theme-high-contrast {
    --bg-color: #000000;
    --text-color: #ffffff;
    --highlight-color: #ffdd00;
    --button-text-color: #000000;
    --card-bg: #000000;
    --card-border: #ffffff;
}

.theme-blue {
    --bg-color: #eaf3ff;
    --text-color: #000033;
    --highlight-color: #003399;
    --button-text-color: #ffffff;
    --card-bg: #ffffff;
    --card-border: #90caf9;
}

.theme-dark {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --highlight-color: #ff6f00;
    --button-text-color: #000000;
    --card-bg: #1e1e1e;
    --card-border: #333333;
}

.theme-light {
    --bg-color: #ffffff;
    --text-color: #000000;
    --highlight-color: #bb0ae7;
    --button-text-color: #ffffff;
    --card-bg: #ffffff;
    --card-border: #ccc;
    --teal-button-bg: #008080;
}

.theme-neon {
    --bg-color: #0f001f;
    --text-color: #f0f0f0;
    --highlight-color: #00ffdd;
    --button-text-color: #0f001f;
    --card-bg: rgba(0, 255, 221, 0.05);
    --card-border: rgba(0, 255, 221, 0.4);
    --teal-button-bg: #00c0a0;
}

.theme-teal-orange {
    --bg-color: #004d40;
    --text-color: #e0f2f1;
    --highlight-color: #ff9800;
    --button-text-color: #000000;
    --card-bg: rgba(0, 105, 92, 0.2);
    --card-border: rgba(255, 152, 0, 0.3);
    --teal-button-bg: #ff9800;
}

.theme-cosmic {
    --bg-color: #312e81;
    --text-color: white;
    --highlight-color: #22d3ee;
    --button-text-color: white;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(56, 189, 248, 0.3);
    --teal-button-bg: #059669;
}

/********************************************
 * Responsive
 ********************************************/
@media screen and (max-width: 768px) {
    #filters,
    .recipe-selection button,
    .navigation-buttons {
        text-align: center;
    }
    .recipe-selection button {
        font-size: 14px;
        padding: 10px;
    }
    /* Prevent iOS zoom on focused inputs/selects */
    #filters select,
    #filters button,
    .navigation-buttons button,
    select, input[type="text"], input[type="search"] {
        font-size: 16px;
    }
    .header-controls { gap: 10px; flex-wrap: wrap; justify-content: center; }
    #app-container { margin: 12px auto; padding: 14px; }
    header { padding: 14px 10px; }
    header h1 { font-size: 1.5rem; line-height: 1.2; }
}

@media screen and (max-width: 480px) {
    .header-controls { gap: 8px; }
    .control-group { width: 100%; justify-content: center; }
    #filters select { width: 100%; margin: 4px 0; }
    .recipe-card { padding: 12px; }
    .navigation-buttons button { width: 100%; margin: 4px 0; }
    .navigation-buttons .home-link { display: block; width: 100%; box-sizing: border-box; }
    header h1 { font-size: 1.25rem; }
}