/* Orasync - Centered Layout */

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-dark: #0a0a0f;
    --accent: #00e676;
    --accent-glow: rgba(0, 230, 118, 0.3);
    --accent-soft: rgba(0, 230, 118, 0.1);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-dim: #8a8a9a;
    --danger: #ff4466;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Syne', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ==================== App Container ==================== */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

/* ==================== Header ==================== */
.header {
    text-align: center;
    padding: 0.5rem 0;
    flex-shrink: 0;
}

.logo {
    font-family: 'Syne', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.tagline {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ==================== Settings Panel ==================== */
.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
}

/* ==================== Input Sections ==================== */
.input-section {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* ==================== Text Input ==================== */
.text-area-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.text-input {
    flex: 1;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.text-input::placeholder {
    color: var(--text-dim);
}

/* ==================== File Drop ==================== */
.file-drop {
    width: 50px;
    height: 100px;
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.file-drop:hover, .file-drop.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.file-drop-icon {
    color: var(--text-dim);
    transition: color 0.2s;
}

.file-drop:hover .file-drop-icon {
    color: var(--accent);
}

/* ==================== Settings Grid ==================== */
.settings-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-value {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px var(--accent-glow);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.language-auto {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 0.25rem;
}

/* ==================== Action Buttons ==================== */
.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.start-btn {
    flex: 1;
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    padding: 0.9rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.start-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.fullscreen-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.9rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.fullscreen-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== Prompter Panel ==================== */
.prompter-panel {
    flex: 1;
    background: var(--bg-dark);
    border-radius: 0.75rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.prompter-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1rem;
}

.prompter-placeholder.hidden {
    display: none;
}

.prompter-content {
    display: none;
    flex-direction: column;
    height: 100%;
}

.prompter-content.active {
    display: flex;
}

/* ==================== Status Bar ==================== */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.status-dot.listening {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.progress-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
}

/* ==================== Text Viewport ==================== */
.text-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.text-container {
    position: absolute;
    width: 100%;
    padding: 0 8%;
    transition: transform 0.15s ease-out;
}

.prompter-word {
    display: inline;
    transition: color 0.1s, text-shadow 0.1s;
    line-height: 1.5;
}

.prompter-word.read {
    color: rgba(255, 255, 255, 0.15);
}

.prompter-word.current {
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
}

.prompter-word.upcoming {
    color: #ffffff;
}

/* ==================== Gradients & Center Line ==================== */
.center-line {
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    pointer-events: none;
    z-index: 5;
}

.gradient-top, .gradient-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
    z-index: 10;
}

.gradient-top {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-dark), transparent);
}

.gradient-bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-dark), transparent);
}

/* ==================== Footer ==================== */
.site-footer {
    padding: 0.75rem 0 0.25rem;
    text-align: center;
    flex-shrink: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.25rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copyright {
    font-size: 0.65rem;
    color: var(--text-dim);
}

/* ==================== Fullscreen Prompter ==================== */
.fullscreen-prompter {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 1000;
    flex-direction: column;
}

.fullscreen-prompter.active {
    display: flex;
}

.progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--accent-glow);
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fullscreen-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: 'Syne', sans-serif;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.control-btn.danger {
    background: var(--danger);
    border-color: var(--danger);
}

.control-btn.danger:hover {
    background: #ff2244;
}

.fullscreen-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.fullscreen-content .text-container {
    padding: 0 10%;
}

.fullscreen-content .gradient-top,
.fullscreen-content .gradient-bottom {
    height: 100px;
}

/* ==================== Browser Warning ==================== */
.browser-warning {
    background: var(--danger);
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    display: none;
}

.browser-warning.visible {
    display: block;
}

/* ==================== Responsive ==================== */
@media (max-width: 700px) {
    .app-container {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.8rem;
    }

    .settings-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .text-input {
        height: 80px;
        min-height: 80px;
        max-height: 80px;
        font-size: 0.8rem;
    }

    .file-drop {
        width: 45px;
        height: 80px;
    }

    .input-section {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 500px) {
    .app-container {
        padding: 0.5rem 0.75rem;
    }

    .header {
        padding: 0.25rem 0;
    }

    .logo {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.75rem;
    }

    .settings-list {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .setting-item:last-child {
        grid-column: span 2;
    }

    .text-input {
        height: 70px;
        min-height: 70px;
        max-height: 70px;
        font-size: 0.75rem;
    }

    .file-drop {
        width: 40px;
        height: 70px;
    }

    .input-section {
        padding: 0.6rem 0.75rem;
    }

    .section-title {
        font-size: 0.6rem;
        margin-bottom: 0.5rem;
    }

    .start-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .prompter-panel {
        margin-top: 0.75rem;
        min-height: 150px;
    }

    .site-footer {
        padding: 0.5rem 0 0;
    }

    .footer-links a {
        font-size: 0.65rem;
    }
}

@media (max-height: 700px) {
    .header {
        padding: 0.25rem 0;
    }

    .settings-panel {
        gap: 0.75rem;
    }

    .text-input {
        height: 70px;
        min-height: 70px;
        max-height: 70px;
    }

    .file-drop {
        height: 70px;
    }

    .prompter-panel {
        margin-top: 0.75rem;
    }
}

@media (max-height: 550px) {
    .tagline {
        display: none;
    }

    .input-section {
        padding: 0.5rem 0.75rem;
    }

    .text-input {
        height: 60px;
        min-height: 60px;
        max-height: 60px;
    }

    .file-drop {
        height: 60px;
    }

    .site-footer {
        display: none;
    }

    .prompter-panel {
        min-height: 120px;
    }
}
