:root {
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.2);
    --glow-color: rgba(255, 30, 80, 0.5);
    /* funkelrot glow */
}

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

body {
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #020024 0%, #090979 35%, #4a001f 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Main Container */
.glass-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Hidden Admin Button */
#hidden-admin-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    cursor: default;
    z-index: 100;
}

/* Hero */
.hero {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    background: linear-gradient(to bottom, #000 0%, #000 calc(100% - 2rem), transparent 100%);
    padding: 0 0 2rem 0;
    /* No top padding, 2rem at bottom for the gradient fade */
    margin: 0 0 4rem 0;
    /* Space before content starts */
}

#hero-video {
    width: 100%;
    max-width: 800px;
    height: auto;
}

/* Typography */
h2 {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 2rem;
    /* bit more space for the button */
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-section {
    margin-bottom: 4rem;
}

/* Admin Specific UI Elements */
.admin-add-btn {
    display: none;
    /* hidden by default */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: normal;
}

.admin-add-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px var(--glow-color);
}

.delete-btn {
    display: none;
    /* hidden by default */
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 50, 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
}

.delete-btn:hover {
    transform: scale(1.1);
    background: red;
}

#admin-logout-btn {
    display: none;
    /* hidden by default */
    margin-top: 1rem;
}

/* Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-card:hover {
    transform: scale(1.05) translateY(-5px);
    border-color: var(--glass-highlight);
    box-shadow: 0 8px 32px var(--glow-color);
    z-index: 10;
}

.card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Fallback Play Button Background */
.fallback-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.4), rgba(30, 30, 50, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 0;
}

.play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.play-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
    margin-left: 4px;
}

.glass-card:hover .play-icon {
    border-color: var(--glass-highlight);
    box-shadow: 0 0 20px var(--glow-color);
    transform: scale(1.1);
}

.card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    z-index: 2;
    font-size: 0.9rem;
    font-weight: 400;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(20, 20, 30, 0.6);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1001;
    /* Ensure modal content is above modal overlay */
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #ff1e50;
}

.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    z-index: 5;
    pointer-events: auto;
}

/* Custom Modal / Inputs */
.admin-modal-content {
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 2rem;
}

.admin-modal-content h2 {
    margin-bottom: 1.5rem;
}

.glass-input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.glass-input:focus {
    border-color: var(--glass-highlight);
}

.glass-btn {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px var(--glow-color);
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 10;
}

/* Footer */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.impressum {
    padding: 2rem 4rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .glass-container {
        padding: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
}