/**
 * Project: Anti-Coriander Translator (Executive Edition)
 * Version: 2.0.0
 * Description: Executive "Charcoal & Slate" theme with high-contrast 
 * focus on the primary translation phrase.
 * Author: Gemini & Collaboration
 * Date: 2026-02-12
 */

/* Color Palette & Variables */
/**
 * Project: Anti-Coriander Translator (Executive Edition)
 * Updated: Responsive Full-Screen Background Implementation
 */

:root {
    --bg-charcoal: #121212;
    --bg-slate: #1e1e1e;
    --border-executive: #333333;
    --text-primary: #ffffff;
    --text-muted: #888888;
    --accent-blue: #007aff;
    --danger-rose: #ff453a;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.7); /* Deepened for background depth */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
    background-color: var(--bg-charcoal);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 60px 20px;
    margin: 0;
    overflow-x: hidden;
    position: relative;
}

/* Full-Screen Responsive Background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Ensure filename matches exactly */
    background-image: url('coriander_background.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15; /* Keeps the "Charcoal" executive feel while adding texture */
    z-index: -1;   /* Places it behind all UI elements */
    pointer-events: none;
}

/* Ensure the app container sits cleanly on top */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Global Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
    background-color: var(--bg-charcoal);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 60px 20px;
}

.app-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Typography */
h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-align: center;
}

h2 {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Search Interface */
.search-wrap {
    display: flex;
    gap: 12px;
}

input#countrySearch {
    flex-grow: 1;
    background-color: var(--bg-slate);
    border: 1px solid var(--border-executive);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input#countrySearch:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
}

button#randomBtn {
    background-color: var(--bg-slate);
    border: 1px solid var(--border-executive);
    border-radius: 12px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

button#randomBtn:hover {
    background-color: #252525;
    transform: rotate(10deg) scale(1.05);
}

/* Result Card */
#resultCard {
    background-color: var(--bg-slate);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--border-executive);
    box-shadow: var(--shadow);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#flagContainer {
    margin-bottom: 24px;
}

#flagContainer img {
    height: 48px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* The Focal Point: Translation Text */
.translation-focus {
    margin: 24px 0;
}

#phraseDisplay {
    font-size: 2.8rem; /* Ultra-large for focus */
    font-weight: 800;
    color: var(--danger-rose);
    line-height: 1.1;
    text-transform: uppercase;
}

#regionTag {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
}

/* Voice Controls */
.voice-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0;
    text-align: left;
}

.control-group label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 700;
}

select {
    width: 100%;
    background-color: var(--bg-charcoal);
    border: 1px solid var(--border-executive);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

/* Master Listen Button */
#speakBtn {
    width: 100%;
    background-color: var(--text-primary);
    color: var(--bg-charcoal);
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

#speakBtn:hover {
    opacity: 0.9;
}

#speakBtn:active {
    transform: scale(0.98);
}

/* Footer Styling */
footer {
    position: fixed;
    bottom: 20px;
    width: 100%;
    text-align: center;
    left: 0;
}

#copyright {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Helper Classes */
.hidden {
    display: none;
}

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