:root {
    --bg-color: #f3f4f6;
    /* Light Gray Background */
    --surface-color: #ffffff;
    /* White Surface */
    --primary-color: #3b82f6;
    /* Bright Blue */
    --secondary-color: #6366f1;
    /* Indigo */
    --text-color: #1f2937;
    /* Dark Gray Text */
    --text-muted: #6b7280;
    /* Gray Text */
    --border-color: #e5e7eb;
    /* Light Border */
    --accent-bg: #eff6ff;
    /* Light Blue Accent */
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #e5e7eb;
    /* Outer body bg */
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    height: 100%;
    max-height: 900px;
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid white;
    overflow: hidden;
}

/* Global Header inside App */
.main-header {
    height: 60px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    flex-shrink: 0;
    /* Never shrink */
    z-index: 50;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand-logo-link img {
    height: 32px;
    width: auto;
    display: block;
    transition: transform 0.2s;
}

.brand-logo-link:hover img {
    transform: scale(1.05);
}

/* Wrapper for Landing and Editor */
.content-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
    width: 100%;
}

/* Landing / Drop Zone */
.landing-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Allow scrolling for info */
    background-color: var(--bg-color);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.landing-page.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.drop-area-container {
    flex: 1;
    min-height: 300px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.drop-zone {
    width: 100%;
    max-width: 600px;
    height: 250px;
    background-color: var(--surface-color);
    border: 3px dashed var(--border-color);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
    border-color: var(--primary-color);
    background-color: var(--accent-bg);
    transform: scale(1.02);
}

.drop-content {
    text-align: center;
}

.drop-content h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.drop-content p {
    color: var(--text-muted);
}

.icon-large {
    font-size: 56px !important;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Info Sections */
.info-section {
    background-color: var(--surface-color);
    padding: 60px 40px;
    border-top: 1px solid var(--border-color);
}

.section-content {
    max-width: 800px;
    margin: 0 auto;
}

.info-header {
    text-align: center;
    margin-bottom: 40px;
}

.info-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.info-header p {
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background-color: var(--bg-color);
}

.feature-icon {
    font-size: 40px !important;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.steps-list {
    list-style: none;
    counter-reset: step-counter;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.step-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
}

.step-number {
    background-color: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Editor Interface */
.editor-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background-color: var(--surface-color);
}

/* Toolbar */
.toolbar {
    height: 70px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tool-btn,
.icon-btn,
.text-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap;
    /* Prevent button text wrap */
}

.tool-btn:hover,
.icon-btn:hover,
.text-btn:hover {
    color: var(--primary-color);
    background-color: var(--accent-bg);
}

/* Volume Control in Toolbar */
.volume-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-color);
    /* Light gray for input bg */
    padding: 8px 16px;
    border-radius: 30px;
    margin-left: 10px;
}

.volume-control-group input[type="range"] {
    width: 100px;
    accent-color: var(--primary-color);
}

#volume-value {
    font-size: 0.85rem;
    width: 40px;
    text-align: right;
    font-weight: 600;
}

/* Waveform Area */
.waveform-container {
    flex: 1;
    position: relative;
    background-color: #fafafa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
    /* Ensure visibility */
}

.filename-display {
    position: absolute;
    top: 25px;
    width: 100%;
    text-align: center;
    color: var(--text-color);
    font-weight: 600;
    pointer-events: none;
    z-index: 5;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 20px;
}

#waveform {
    width: 100%;
    height: 300px;
}

/* Footer Controls */
.controls-bar {
    height: 90px;
    padding: 0 40px;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.primary-icon-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.primary-icon-btn:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

.time-display {
    font-variant-numeric: tabular-nums;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    /* Allow time to wrap if needed */
}

.selection-time {
    color: var(--primary-color);
    margin-left: 12px;
    font-weight: 600;
    background-color: var(--accent-bg);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.export-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.select-wrapper select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--text-color);
    /* Black button */
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Helper Class */
.hidden {
    display: none !important;
}

/* Scrollbar styling for landing page */
.landing-page::-webkit-scrollbar {
    width: 8px;
}

.landing-page::-webkit-scrollbar-track {
    background: transparent;
}

.landing-page::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 20px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    body {
        padding: 0;
        /* Full screen on mobile */
    }

    .app-container {
        border-radius: 0;
        border: none;
        max-height: none;
    }

    /* Landing adjustments */
    .drop-area-container {
        padding: 20px;
    }

    .drop-zone {
        height: 200px;
    }

    .info-section {
        padding: 40px 20px;
    }

    /* Editor Mobile Layout */
    .toolbar {
        height: auto;
        min-height: 60px;
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .tool-group {
        gap: 10px;
        flex-wrap: wrap;
    }

    .volume-control-group {
        padding: 6px 12px;
    }

    .volume-control-group input[type="range"] {
        width: 80px;
    }

    .text-btn span:not(.material-symbols-rounded) {
        /* Hide text on very small screens if desirable, or keep it */
        /* display: none; */
    }

    /* Footer Mobile Layout - Stacked */
    .controls-bar {
        height: auto;
        min-height: 120px;
        padding: 20px;
        flex-direction: column;
        gap: 20px;
        justify-content: center;
    }

    .playback-controls {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        /* Play button top, time bottom */
        gap: 15px;
    }

    .time-display {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .selection-time {
        margin-left: 0;
        /* Removing left margin since stacked */
    }

    .export-controls {
        width: 100%;
        justify-content: center;
    }

    .btn-primary {
        width: 100%;
        /* Full width save button */
        max-width: 200px;
        padding: 12px 0;
        text-align: center;
    }
}