/* ========== CSS Variables ========== */
:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --dark: #1a1a2e;
    --darker: #16213e;
    --light: #f5f6fa;
    --text: #2d3436;
    --text-light: #636e72;
    --shadow: 0 10px 40px rgba(0,0,0,0.1);
    --shadow-hover: 0 15px 50px rgba(0,0,0,0.2);
    --radius: 20px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Noto Sans Bengali', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Background animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: bgPulse 10s ease-in-out infinite;
    z-index: 0;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========== Container ========== */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
}

/* ========== Screens ========== */
.screen {
    animation: fadeInUp 0.5s ease;
}

.hidden {
    display: none !important;
}

/* ========== Privacy Card ========== */
.privacy-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 50px 40px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 550px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.lock-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.privacy-card h1 {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

/* Warning Box */
.warning-box {
    background: linear-gradient(135deg, #fff5f5, #ffe0e0);
    border: 2px solid #ff8787;
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.warning-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 5px;
}

.warning-text {
    color: #c92a2a;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.warning-box p {
    color: #e03131;
    font-size: 14px;
    line-height: 1.5;
}

/* Permission List */
.permission-list {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.perm-item {
    background: linear-gradient(135deg, #f0f0ff, #e8e8ff);
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 500;
    color: var(--primary-dark);
    font-size: 14px;
    border: 1px solid #d0d0ff;
}

.perm-item span {
    margin-right: 5px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    margin: 20px 0;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.privacy-note {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}

/* ========== Recording Screen ========== */
.recording-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.recording-header h2 {
    color: var(--text);
    font-size: 24px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-light);
}

.status-indicator .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

.status-indicator.recording .dot {
    background: var(--danger);
    animation: blink 1s infinite;
}

/* Camera Container */
.camera-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.camera-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: var(--transition);
}

.camera-box.recording {
    border-color: var(--danger);
    animation: recordingBorder 2s infinite;
}

.camera-label {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 16px;
}

.camera-box video {
    width: 100%;
    display: block;
    background: #000;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Recording Controls */
.recording-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.timer-display {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.timer-icon {
    font-size: 24px;
}

.timer-text {
    font-size: 56px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--text);
    letter-spacing: 3px;
}

.timer-text.recording {
    color: var(--danger);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Record Button */
.btn-record {
    background: linear-gradient(135deg, var(--danger), #c0392b);
    color: white;
    border: none;
    padding: 18px 45px;
    font-size: 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

.btn-record:hover {
    transform: scale(1.05);
}

.record-icon {
    font-size: 24px;
}

/* Stop Button */
.btn-stop {
    background: linear-gradient(135deg, #333, #000);
    color: white;
    border: none;
    padding: 18px 45px;
    font-size: 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-stop:hover {
    background: linear-gradient(135deg, #555, #222);
}

/* Pause Button */
.btn-pause {
    background: linear-gradient(135deg, var(--warning), #e67e22);
    color: white;
    border: none;
    padding: 18px 45px;
    font-size: 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Upload Section */
.upload-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 25px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.upload-progress {
    text-align: center;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--text);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark), var(--success));
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressGlow 2s infinite;
}

.upload-status-text {
    color: var(--text-light);
    font-size: 14px;
}

/* ========== Success Screen ========== */
.success-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 50px 40px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: bounce 1s ease;
}

.success-card h2 {
    color: var(--success);
    font-size: 28px;
    margin-bottom: 10px;
}

.success-card p {
    color: var(--text-light);
    margin-bottom: 10px;
}

.recording-id {
    background: #f0f0f0;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: monospace;
    font-size: 14px;
    margin: 15px 0;
    display: inline-block;
}

/* ========== Loading Overlay ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes recordingBorder {
    0%, 100% { border-color: var(--danger); box-shadow: 0 0 10px rgba(231, 76, 60, 0.3); }
    50% { border-color: #ff6b6b; box-shadow: 0 0 25px rgba(231, 76, 60, 0.6); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes progressGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .camera-container {
        grid-template-columns: 1fr;
    }
    
    .privacy-card {
        padding: 30px 20px;
    }
    
    .privacy-card h1 {
        font-size: 24px;
    }
    
    .lock-icon {
        font-size: 60px;
    }
    
    .timer-text {
        font-size: 40px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn-record,
    .btn-stop,
    .btn-pause {
        width: 100%;
        justify-content: center;
    }
    
    .recording-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .permission-list {
        flex-direction: column;
        align-items: center;
    }
    
    .perm-item {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .privacy-card {
        padding: 20px 15px;
    }
    
    .recording-controls {
        padding: 20px 15px;
    }
    
    .timer-text {
        font-size: 32px;
    }
}