:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --bg-dark: #000000;
    --bg-card: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --success-color: #10b981;
    --error-color: #ef4444;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

.app-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 20px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    animation: fadeInDown 0.6s ease-out;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
}

.screen {
    width: 100%;
    height: 100vh;
    animation: fadeIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    display: none;
}

.card {
    position: relative;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.webcam-preview {
    position: relative;
    width: 100%;
    flex: 1;
    background: #000;
    overflow: hidden;
}

.webcam-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.camera-overlay.hidden {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    margin: 20px;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6);
}

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

.btn-secondary {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5);
    margin: 20px;
}

.btn-secondary:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 25px rgba(236, 72, 153, 0.6);
}

.btn-outline {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    width: calc(100% - 40px);
    margin: 20px;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-large {
    width: calc(100% - 40px);
    padding: 18px 32px;
    font-size: 1.2rem;
}

.icon {
    font-size: 1.2rem;
}

.recording-preview {
    position: relative;
    width: 100%;
    flex: 1;
    background: #000;
    overflow: hidden;
}

.recording-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.countdown-ring {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 100px;
    height: 100px;
}

.countdown-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.bg-circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.progress-circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.recording-status {
    text-align: center;
    color: var(--error-color);
    font-weight: 500;
    animation: pulse 1s ease-in-out infinite;
}

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

.card h2 {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    padding: 20px;
    margin: 0;
}

.video-result {
    width: 100%;
    flex: 1;
    background: #000;
    overflow: hidden;
}

.video-result video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.upload-section {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    padding: 40px 20px 20px;
}

.upload-progress {
    text-align: center;
    padding: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.result-actions {
    text-align: center;
}

.qr-container {
    margin-bottom: 15px;
}

#qrcode {
    display: inline-block;
    padding: 15px;
    background: white;
    border-radius: 12px;
    margin-bottom: 10px;
}

#qrcode img {
    display: block;
}

.qr-container p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-actions .btn {
    width: 100%;
}

.hidden {
    display: none !important;
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .countdown-ring {
        width: 80px;
        height: 80px;
        bottom: 20px;
        right: 20px;
    }

    .countdown-text {
        font-size: 1.2rem;
    }

    .card h2 {
        font-size: 1.2rem;
    }
}
