:root {
    --primary-color: #00f2ea;
    --secondary-color: #ff0050;
    --background-color: #0a0a0a;
    --text-color: #ffffff;
    --glass-opacity: 0.05;
    --border-radius: 20px;
    --glass-bg: rgba(255, 255, 255, var(--glass-opacity));
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: "Inter", sans-serif;
}

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

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Background Animation */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
            circle at center,
            rgba(0, 242, 234, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 20%,
            rgba(255, 0, 80, 0.05) 0%,
            transparent 40%
        );
    z-index: -1;
    animation: bg-spin 20s linear infinite;
}

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

/* Views */
.view {
    display: none;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.view.active {
    display: flex;
    opacity: 1;
}

/* Video Player */
#player-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#drawing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Low z-index */
    object-fit: cover; /* Cover the whole screen */
    opacity: 0.8;
}

#player-container {
    position: relative;
    z-index: 5; /* Higher than drawing */
}

iframe,
video {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 50px rgba(0, 242, 234, 0.2);
    border-radius: 12px;
}

/* Admin Panel */
#admin-view {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    height: auto;
    min-height: 100vh;
    justify-content: flex-start;
}

.admin-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

h1,
h2 {
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(
        45deg,
        var(--primary-color),
        var(--secondary-color)
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

input[type="text"],
input[type="url"],
input[type="color"] {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

input[type="color"] {
    height: 50px;
    cursor: pointer;
    padding: 5px;
}

/* Drawing Canvas */
.canvas-container {
    width: 100%;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    touch-action: none; /* Prevent scrolling while drawing */
}

#drawing-canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.drawing-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(
        45deg,
        var(--primary-color),
        var(--secondary-color)
    );
    color: white;
    box-shadow: 0 4px 15px rgba(0, 242, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-right: 10px;
}

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

.btn-danger {
    background: rgba(255, 0, 80, 0.2);
    color: #ff0050;
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-danger:hover {
    background: rgba(255, 0, 80, 0.3);
}

/* Video List */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.video-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.video-item:hover {
    border-color: var(--glass-border);
}

.video-url {
    font-family: monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    color: white;
    transform: translateY(100px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}
