/* =========================================
   1. VARIABLES & RESET (V7 Blue Theme)
   ========================================= */
:root {
    /* Colors */
    --primary-color: #007bff;
    --primary-gradient: linear-gradient(135deg, #007bff 0%, #00d4ff 100%);
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    
    /* Theme Colors */
    --bg-color: #f4f6f9;
    --container-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --input-bg: #f8f9fa;
    --card-hover: #f1f7ff;
    
    /* Dimensions */
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body.dark-theme {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #e0e0e0;
    --border-color: #404040;
    --input-bg: #333333;
    --card-hover: #3a3a3a;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; transition: background-color 0.3s, color 0.3s; }

body {
    font-family: 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

/* =========================================
   2. CONTAINER & HEADER
   ========================================= */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--container-bg);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-controls { display: flex; align-items: center; gap: 15px; }

.session-timer {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}
.session-timer.warning { color: #ffc107; background: rgba(255, 193, 7, 0.1); }
.session-timer.expired { color: #dc3545; background: rgba(220, 53, 69, 0.1); }

/* =========================================
   3. BUTTONS
   ========================================= */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    background-color: var(--secondary-color);
    transition: transform 0.1s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.button-group { display: flex; gap: 10px; margin-bottom: 20px; }
.button-group .btn { flex: 1; }

/* Button Colors */
.btn:nth-child(1) { background: var(--primary-gradient); } /* Translate */
.btn:nth-child(2) { background: #17a2b8; } /* Normalize */
.btn:nth-child(3) { background: var(--danger-color); } /* Delete */

/* Utility Buttons */
.copy-all-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    background: var(--success-color);
    border-radius: 4px;
    margin-left: 10px;
}
.retranslate-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
}

/* =========================================
   4. INPUT & LAYOUT
   ========================================= */
.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 10px;
}
@media (max-width: 900px) { .input-section { grid-template-columns: 1fr; } }

.input-column h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
}
.teams-column h2 { border-left-color: var(--danger-color); }

.input-box {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: monospace;
    font-size: 0.95rem;
    resize: vertical;
}
.input-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

/* =========================================
   5. INLINE RESULTS (Card Style)
   ========================================= */
.inline-results { margin-top: 20px; }

.translation-group {
    border-top: 2px dashed var(--border-color);
    padding-top: 15px;
}

.result-block {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
    transition: box-shadow 0.2s;
}
.result-block:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    background: var(--card-hover);
}

.original-text {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.language-output { margin-bottom: 4px; }

.language-output-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    border-left: 3px solid transparent;
}
.language-output-content:hover { background-color: rgba(0,0,0,0.05); }

/* Language Colors */
.english .language-output-content { border-left-color: var(--primary-color); }
.georgian .language-output-content { border-left-color: var(--danger-color); }
.russian .language-output-content { border-left-color: var(--success-color); }

.translation-text { font-weight: 500; font-size: 0.95rem; }

/* Cycle Buttons */
.cycle-buttons { display: flex; gap: 4px; }
.cycle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 5px;
}

/* =========================================
   6. UTILITIES (Gate, Loader, Toast)
   ========================================= */
/* Loading */
.loading {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: var(--primary-color);
    font-weight: bold;
}
.spinner {
    width: 25px; height: 25px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Access Gate */
#access-gate {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.95); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s;
}
.gate-card {
    background: var(--container-bg); padding: 40px; border-radius: 15px;
    text-align: center; max-width: 400px; width: 90%;
}
#pin-input {
    font-size: 2rem; letter-spacing: 10px; text-align: center;
    width: 100%; margin: 20px 0; padding: 10px;
    background: var(--input-bg); color: var(--text-color);
    border: 2px solid var(--border-color); border-radius: 8px;
}

/* Toast */
.copy-feedback {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: #333; color: white; padding: 10px 25px; border-radius: 30px;
    opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 2000;
}
.copy-feedback.show { opacity: 1; }