:root {
    --bg-color: #050508;
    --panel-bg: rgba(20, 20, 28, 0.65);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-primary: #00e5ff;
    --accent-secondary: #8a2be2;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --success: #00ff66;
    --error: #ff3366;
    --warning: #ffcc00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(138, 43, 226, 0.15), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(0, 229, 255, 0.15), transparent 30%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

.app-container {
    width: 100%;
    max-width: 480px;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7);
    transition: box-shadow 0.3s ease;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
}

header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 60%);
    opacity: 0.15;
    filter: blur(20px);
    z-index: -1;
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #fff, #b8c8d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#status-text {
    color: var(--accent-primary);
    font-size: 0.95rem;
    font-weight: 400;
    height: 20px;
    transition: color 0.3s ease;
}

.video-container {
    width: 100%;
    background-color: #000;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.05);
    display: flex;
}

.video-wrapper {
    position: relative;
    width: 100%;
    line-height: 0;
}

video {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1); /* Mirror */
    aspect-ratio: 4/3;
    object-fit: cover;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    transform: scaleX(-1); /* Mirrors canvas drawing to match video */
}

/* Scanning animation */
.scanning-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-primary), 0 0 30px var(--accent-primary);
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scanning-bar.active {
    opacity: 0.8;
    animation: scan 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    5% { opacity: 0.8; }
    45% { opacity: 0.8; }
    50% { top: calc(100% - 3px); opacity: 0; }
    55% { opacity: 0.8; }
    95% { opacity: 0.8; }
    100% { top: 0; opacity: 0; }
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

input[type="url"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn {
    padding: 1rem 0.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), #0099ff);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.primary-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.4);
}

.secondary-btn {
    background: transparent;
    color: #fff;
    border: 1px solid var(--accent-secondary);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.1);
}

.secondary-btn:not(:disabled):hover {
    background: rgba(138, 43, 226, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.25);
}

/* Multi-Face Edit Layout Updates */
.single-btn {
    grid-template-columns: 1fr;
}

.footer-links {
    margin-top: 1.5rem;
    text-align: center;
}

.edit-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.edit-link:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.video-container.small {
    margin-bottom: 1.5rem;
}

.profiles-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.profiles-section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profiles-list {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.profiles-list::-webkit-scrollbar {
    width: 6px;
}

.profiles-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.profiles-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.3);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.profile-item:hover {
    background: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.1);
}

.profile-url {
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.delete-btn {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.4rem;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    transform: scale(1.15);
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
    background: rgba(255, 51, 102, 0.1);
}
