/* Vocara Dark Mode Design System - Electric Orange & Pitch Black */
:root {
    --bg-dark: #070709;
    --bg-card: rgba(18, 18, 24, 0.85);
    --bg-card-hover: rgba(28, 28, 36, 0.9);
    --border-color: rgba(255, 255, 255, 0.09);
    --border-highlight: rgba(255, 107, 0, 0.45);
    
    --primary: #ff6b00;
    --primary-hover: #e05e00;
    --primary-glow: rgba(255, 107, 0, 0.4);
    
    --accent: #ff8c00;
    --accent-glow: rgba(255, 140, 0, 0.3);
    
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
    --glass-backdrop: blur(16px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

body {
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(255, 107, 0, 0.14) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(255, 140, 0, 0.09) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255, 85, 0, 0.06) 0%, transparent 60%);
    background-attachment: fixed;
    padding-bottom: 60px;
}

/* App Container */
.app-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: 46px;
    width: auto;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: rgba(255, 107, 0, 0.15);
    border: 1px solid var(--border-highlight);
    color: #ff9d42;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Navigation Tabs */
.tab-nav {
    display: flex;
    background: rgba(12, 12, 16, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 28px;
    gap: 6px;
    backdrop-filter: var(--glass-backdrop);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px; /* Touch friendly */
}

.tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.tab-btn:not(.active):hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

/* Panel System */
.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Glassmorphism Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: var(--glass-backdrop);
    box-shadow: var(--shadow-subtle);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Recording Controls */
.recorder-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.rec-btn-container {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-pulse-ring {
    position: absolute;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 0, 0.4);
    animation: rippleGlow 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    pointer-events: none;
}

@keyframes rippleGlow {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 0.2; }
    100% { transform: scale(1.4); opacity: 0; }
}

.rec-btn {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #ff6b00, #e05e00);
    border: 3px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.45);
    z-index: 2;
}

.rec-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 14px 40px rgba(255, 107, 0, 0.65);
}

.rec-btn:active {
    transform: scale(0.94);
}

.rec-icon-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.rec-btn.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: rgba(255, 255, 255, 0.4);
    animation: pulseRecording 1.2s infinite ease-in-out;
    box-shadow: 0 10px 35px rgba(239, 68, 68, 0.6);
}

.rec-btn.recording .rec-pulse-ring {
    border-color: rgba(239, 68, 68, 0.6);
}

@keyframes pulseRecording {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 24px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.timer-display {
    font-family: 'JetBrains Mono', monospace, monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.rec-status-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* Waveform Canvas Shell */
.waveform-shell {
    margin-top: 24px;
    background: rgba(10, 15, 26, 0.9);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow: hidden;
}

.waveform-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
}

/* Input Fields & Buttons */
.form-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.input-field {
    flex: 1;
    min-width: 220px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-height: 48px; /* Mobile touch friendly */
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Sound Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.gallery-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-highlight);
}

.g-canvas {
    width: 100%;
    height: 70px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-sm);
}

.g-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.g-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
}

.g-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.g-actions {
    display: flex;
    gap: 8px;
}

/* Scanner Layout */
.scan-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.cam-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #030712;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.cam-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cam-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cam-target-box {
    width: 75%;
    height: 35%;
    border: 2px dashed var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    position: relative;
}

.cam-target-box::after {
    content: "ALIGN SOUND ENGRAVING MOTIF HERE";
    position: absolute;
    bottom: -28px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(15, 23, 42, 0.4);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Match Result Card */
.result-box {
    margin-top: 24px;
    padding: 20px;
    border-radius: var(--radius-md);
    display: none;
}

.result-box.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.result-box.match {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent);
}

.result-box.no-match {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
}

.result-header {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.match .result-header { color: var(--accent); }
.no-match .result-header { color: var(--danger); }

.result-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

/* Mobile App Section */
.app-download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.app-platform-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}

.app-icon-lg {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

/* Hero Emotional Landing Section */
.hero-section {
    margin-bottom: 32px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 107, 0, 0.12);
    border: 1px solid rgba(255, 107, 0, 0.35);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.hero-pill-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

.hero-title {
    font-size: 36px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #ffffff;
}

.gradient-text {
    background: linear-gradient(135deg, #ff6b00, #ff9d42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.hero-feat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.hero-media-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-highlight);
    box-shadow: 0 20px 40px -15px rgba(255, 107, 0, 0.25);
    aspect-ratio: 1/1;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.hero-media-card:hover .hero-img {
    transform: scale(1.04);
}

.hero-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7, 7, 9, 0.85) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 16px;
}

.hero-badge-floating {
    background: rgba(18, 18, 24, 0.9);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(12px);
}

/* Emotional Showcase Grid */
.emotional-showcase-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: center;
}

.emotional-img-wrap {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    aspect-ratio: 1/1;
}

.emotional-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.memory-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.memory-tag {
    background: rgba(255, 107, 0, 0.1);
    border: 1px solid rgba(255, 107, 0, 0.25);
    color: #ff9d42;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

/* Toast */
.toast-msg {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: rgba(18, 18, 24, 0.95);
    border: 1px solid var(--border-highlight);
    color: var(--text-main);
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
}

.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive Rules for Mobile */
@media (max-width: 640px) {
    .app-wrap {
        padding: 16px 12px 60px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 26px;
    }

    .emotional-showcase-grid {
        grid-template-columns: 1fr;
    }

    .app-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px;
    }

    .brand-container {
        justify-content: center;
        width: 100%;
    }

    .header-badges {
        justify-content: center;
        width: 100%;
    }

    .tab-btn {
        padding: 10px 8px;
        font-size: 12px;
    }

    .form-row {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .rec-btn {
        width: 76px;
        height: 76px;
    }

    .cam-target-box {
        width: 85%;
        height: 40%;
    }
}
