/**
 * Facecam Overlay Styles
 * Team Ascend Streaming Overlay
 */

:root {
    --frame-color: #00b4d8;
    --frame-color-secondary: #0077b6;
    --accent-color: #e91e8c;
    --bg-color: transparent;
    --text-color: #ffffff;
    --glow-intensity: 0.4;
}

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

body {
    background: transparent;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.facecam-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--frame-width, 400px);
    height: var(--frame-height, 300px);
    background: var(--bg-color);
    border-radius: 16px;
    overflow: hidden;
}

/* Ensure body takes full size for proper rendering */
/* OBS/TikTok browser source transparency fix */
html, body {
    width: 100%;
    height: 100%;
    background: transparent !important;
    background-color: transparent !important;
}

/* Corner Decorations */
.corner {
    position: absolute;
    width: 60px;
    height: 60px;
    color: var(--frame-color);
    z-index: 10;
    overflow: visible;
}

.corner svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px var(--frame-color));
    stroke-linecap: round;
    stroke-linejoin: round;
}

.corner-tl {
    top: 0;
    left: 0;
}

.corner-tr {
    top: 0;
    right: 0;
}

.corner-bl {
    bottom: 0;
    left: 0;
}

.corner-br {
    bottom: 0;
    right: 0;
}

.corner-accent {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
}

.corner-tl .corner-accent {
    top: 15px;
    left: 15px;
}

.corner-tr .corner-accent {
    top: 15px;
    right: 15px;
}

.corner-bl .corner-accent {
    bottom: 15px;
    left: 15px;
}

.corner-br .corner-accent {
    bottom: 15px;
    right: 15px;
}

/* Edge Lines */
.edge {
    position: absolute;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--frame-color) 20%,
        var(--frame-color) 80%,
        transparent 100%
    );
    z-index: 5;
}

.edge-top,
.edge-bottom {
    height: 2px;
    left: 60px;
    right: 60px;
}

.edge-top {
    top: 0;
}

.edge-bottom {
    bottom: 0;
    display: none; /* Hidden when bottom bar is shown */
}

.edge-left,
.edge-right {
    width: 2px;
    top: 60px;
    bottom: 60px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--frame-color) 20%,
        var(--frame-color) 80%,
        transparent 100%
    );
}

.edge-left {
    left: 0;
}

.edge-right {
    right: 0;
}

/* Diagonal Stripes */
.diagonal {
    position: absolute;
    display: flex;
    gap: 6px;
    z-index: 8;
}

.diagonal-tl {
    top: 8px;
    left: 65px;
    transform: rotate(-45deg);
    transform-origin: left center;
}

.diagonal-br {
    bottom: 8px;
    right: 65px;
    transform: rotate(-45deg);
    transform-origin: right center;
}

.stripe {
    width: 20px;
    height: 6px;
    background: linear-gradient(135deg, var(--frame-color), var(--frame-color-secondary));
    border-radius: 1px;
    box-shadow: 0 0 6px var(--frame-color);
}

/* Glow Effects */
.glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: var(--glow-intensity);
    pointer-events: none;
    z-index: 1;
}

.glow-tl {
    top: -50px;
    left: -50px;
    background: var(--frame-color);
}

.glow-br {
    bottom: -50px;
    right: -50px;
    background: var(--accent-color);
}

/* Bottom Bar */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    z-index: 20;
}

.bar-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        var(--frame-color) 0%,
        var(--frame-color-secondary) 50%,
        var(--accent-color) 100%
    );
    clip-path: polygon(
        0 20%,
        3% 0,
        70% 0,
        73% 20%,
        100% 20%,
        100% 100%,
        0 100%
    );
}

.bar-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 0 20px;
    padding-top: 10px;
}

.team-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: 0.15em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.team-logo {
    height: 35px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Theme Variations */
.theme-blue {
    --frame-color: #00b4d8;
    --frame-color-secondary: #0077b6;
    --accent-color: #e91e8c;
}

.theme-pink {
    --frame-color: #e91e8c;
    --frame-color-secondary: #9d174d;
    --accent-color: #00b4d8;
}

.theme-neon {
    --frame-color: #00ffff;
    --frame-color-secondary: #00cccc;
    --accent-color: #ff00ff;
    --glow-intensity: 0.6;
}

.theme-white {
    --frame-color: #ffffff;
    --frame-color-secondary: #e0e0e0;
    --accent-color: #e91e8c;
}

.theme-gold {
    --frame-color: #ffd700;
    --frame-color-secondary: #b8860b;
    --accent-color: #ff6b35;
}

/* Style Variations */
.style-minimal .diagonal,
.style-minimal .glow {
    display: none;
}

.style-minimal .corner svg {
    filter: none;
}

.style-minimal .stripe {
    box-shadow: none;
}

.style-clean .diagonal,
.style-clean .glow,
.style-clean .corner-accent {
    display: none;
}

.style-clean .edge {
    background: var(--frame-color);
}

/* Bottom bar is always shown - no-bar option removed */

/* Animation for glow */
@keyframes glowPulse {
    0%, 100% {
        opacity: var(--glow-intensity);
        transform: scale(1);
    }
    50% {
        opacity: calc(var(--glow-intensity) * 1.3);
        transform: scale(1.1);
    }
}

.animate-glow .glow {
    animation: glowPulse 3s ease-in-out infinite;
}

.animate-glow .glow-br {
    animation-delay: -1.5s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .glow {
        animation: none !important;
    }
}

/* ========================================
   Bottom Bar Carousel
   ======================================== */
.bar-carousel {
    display: none;
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.carousel-mode .bar-static {
    display: none;
}

.carousel-mode .bar-carousel {
    display: block;
}

.carousel-track {
    position: relative;
    height: 100%;
    width: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 20px;
    padding-top: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.carousel-slide.exit {
    opacity: 0;
    transform: translateY(-20px);
}

.slide-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.1em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slide-logo {
    height: 30px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.slide-icon {
    width: 24px;
    height: 24px;
    color: var(--text-color);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

/* Progress indicator */
.carousel-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    width: 0%;
    animation: progressBar 4s linear infinite;
}

@keyframes progressBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

.carousel-mode .bar-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--frame-color), var(--accent-color));
    animation: progressBar 4s linear infinite;
}
