:root {
    --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --primary-color: #2575fc;
    --secondary-color: #6a11cb;
    --surface-color: #ffffff;
    --text-color: #495057;
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.12);
    --transition-speed: 0.3s;
    --danger-color: #ff4757;
    --success-color: #2ecc71;
}

/* === General Layout === */
body {
    background: var(--primary-gradient);
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    color: var(--text-color);
    position: relative;
}

/* === Landing Page Layout === */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.landing-nav .nav-link {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    margin: 0 .5rem;
    transition: color 0.2s;
}

.landing-nav .nav-link:hover {
    color: #fff;
}

.hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-hero {
    background: white;
    color: var(--secondary-color);
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    color: var(--primary-color);
    background: white;
}

.features-section {
    background: #fff;
    padding: 5rem 0;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: all 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    background: #fff;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.landing-footer {
    background: rgba(0,0,0,0.15);
    padding: 2rem 0;
    color: rgba(255,255,255,0.8);
}

/* === App Container (Tool) === */
.app-wrapper {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.app-container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 85vh; /* Fixed height for better layout control on desktop */
    min-height: 600px;
}

.app-header {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.app-header h4 {
    margin: 0;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.app-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

/* === Media View === */
.media-view {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.audio-visualizer {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
}

/* === Start Options === */
.start-screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}

.start-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 800px;
}

.option-card {
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.option-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    color: var(--secondary-color);
}

.option-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    fill: var(--primary-color);
}

.option-card h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.option-card p {
    font-size: 0.85rem;
    margin: 0;
    color: #6c757d;
}

/* === Controls === */
.app-footer {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.btn {
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.4);
    color: white;
}

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

.btn-light {
    background: #f0f0f0;
    color: #333;
}

.btn-outline-secondary {
    border: 2px solid #e0e0e0;
    background: white;
    color: var(--text-color);
}

.btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #ced4da;
}

/* PiP Controls */
.pip-controls {
    background: rgba(0,0,0,0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    flex-wrap: wrap;
}

.pip-controls .btn-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.pip-controls .btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .pip-controls {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
        border: none;
        border-bottom: 1px solid #eee;
        border-radius: 0;
    }
}

/* PiP Controls */
.pip-controls {
    background: rgba(0,0,0,0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    flex-wrap: wrap;
}

.pip-controls .btn-group .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.pip-controls .btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .pip-controls {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
        border: none;
        border-bottom: 1px solid #eee;
        border-radius: 0;
    }
}

/* === Recording Animation === */
.recording-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    display: none;
    z-index: 10;
}

.recording-indicator.active {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.6);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

.rec-dot {
    width: 10px;
    height: 10px;
    background: var(--danger-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* === Success Screen (Overlay) === */
.success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.success-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.success-card {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--success-color);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out forwards;
}

.toast.toast-success { background: var(--success-color); }
.toast.toast-danger { background: var(--danger-color); }
.toast.toast-info { background: var(--primary-color); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* === Utility === */
.hidden { display: none !important; }
.text-muted { color: #6c757d !important; font-size: 0.85rem; }

/* === Single View (Chat) === */
.single-view {
    background: #fff;
}

.single-view .container {
    max-width: 1200px;
}

.single-view .chatbox {
    height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0 0 8px 8px;
}

.single-view .chat-row {
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* === 404 Page === */
.error-page {
    text-align: center;
    padding: 40px;
    background: white;
}

.error-page h1 {
    font-size: 100px;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

/* === Responsive === */
@media (max-width: 768px) {
    .app-container {
        height: auto;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .start-options {
        grid-template-columns: 1fr;
        max-width: 300px;
    }
    
    .controls-row {
        flex-direction: column;
        width: 100%;
    }
    
    .controls-row .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-title { font-size: 2.2rem; }
    .landing-nav { text-align: center; margin-top: 1rem; }
}

/* === Legal Pages === */
.legal-content {
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.legal-content h1, .legal-content h2, .legal-content h3 {
    color: var(--secondary-color);
    margin-top: 2rem;
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #555;
}
