/* Custom styles for Dub v Sub - Mobile First (Video Backgrounds) */

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Apply animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Background Media System - Video Only, Mobile Optimized */
#backgroundContainer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#backgroundMedia {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 1.5s ease-in-out;
}

#backgroundMedia video {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    transition: all 1.5s ease-in-out;
}

/* Background Overlay - Reduced Opacity */
#backgroundOverlay {
    background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.3) 100%);
    backdrop-filter: blur(1px);
}

/* Mobile-First Header - Moved Down to Reveal Faces */
header {
    padding: 8rem 1rem 2rem 1rem; /* Increased top padding to move content down */
    flex-shrink: 0;
}

header h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    line-height: 1.1;
}

header p {
    font-size: clamp(1rem, 4vw, 1.25rem);
    max-width: 90vw;
}

/* Flexbox layout for bottom positioning */
.min-h-screen.flex.flex-col {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.flex-grow {
    flex-grow: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* Bottom Sign In Section - 35% Opacity */
#signInSection {
    margin: 0;
    padding: 1.5rem;
    border-radius: 1.5rem 1.5rem 0 0; /* Rounded top corners only */
    background: rgba(255, 255, 255, 0.35) !important; /* 35% opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: none;
    border-right: none;
    border-bottom: none;
}

/* Voting and Results Sections - 35% Opacity */
#votingSection,
#resultsSection {
    margin: 0 1rem 1rem 1rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.35) !important; /* 35% opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced Text Contrast for Overlay Boxes */
#signInSection h2,
#votingSection h2,
#resultsSection h2,
#votingSection h3,
#resultsSection h3 {
    color: #111827 !important; /* Very dark gray for headings */
}

#signInSection p,
#votingSection p,
#resultsSection p {
    color: #374151 !important; /* Dark gray for body text */
}

#signInSection .text-gray-500,
#votingSection .text-gray-500,
#resultsSection .text-gray-500 {
    color: #6b7280 !important; /* Darker gray for better contrast */
}

#signInSection .text-gray-600,
#votingSection .text-gray-600,
#resultsSection .text-gray-600 {
    color: #4b5563 !important; /* Darker gray for better contrast */
}

/* Additional Text Contrast Rules for All Overlay Elements */
#signInSection h1, #signInSection h2, #signInSection h3,
#votingSection h1, #votingSection h2, #votingSection h3,
#resultsSection h1, #resultsSection h2, #resultsSection h3 {
    color: #111827 !important; /* Very dark gray for headings */
}

#signInSection p, #signInSection span, #signInSection div,
#votingSection p, #votingSection span, #votingSection div,
#resultsSection p, #resultsSection span, #resultsSection div {
    color: #374151 !important; /* Dark gray for body text */
}

/* Official OAuth Buttons - Mobile Optimized */
.google-signin-button,
.discord-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.google-signin-button {
    background: #ffffff;
    color: #757575;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.google-signin-button:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.google-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.discord-login-button {
    background: #5865f2;
    color: #ffffff;
    border: none;
    border-radius: 4px;
}

.discord-login-button:hover {
    background: #4752c4;
    transform: translateY(-1px);
}

.discord-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Compact Voting Buttons - Side by Side with Flat Design */
.vote-button {
    position: relative;
    padding: 0;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 80px;
    min-width: 140px;
    flex: 1;
    box-shadow: none; /* Remove shadows for flat design */
}

.vote-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.vote-button:hover::before {
    left: 100%;
}

.vote-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); /* Subtle shadow on hover only */
}

.dub-button {
    background: #3b82f6; /* Blue pill color */
    border: 2px solid #1d4ed8; /* Darker blue border */
}

.dub-button:hover {
    background: #2563eb; /* Slightly darker blue on hover */
    border-color: #1e40af;
}

.sub-button {
    background: #ef4444; /* Red pill color */
    border: 2px solid #dc2626; /* Darker red border */
}

.sub-button:hover {
    background: #dc2626; /* Slightly darker red on hover */
    border-color: #b91c1c;
}



.vote-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 12px;
    color: white;
    text-align: center;
}

.vote-text {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 4px;
    text-shadow: none; /* Remove text shadow for flat design */
}

.vote-subtitle {
    font-size: 0.75rem;
    opacity: 0.95;
    font-weight: 500;
    color: #ffffff !important; /* Pure white color */
    font-style: italic !important; /* Italic text */
}

/* Compact Results Layout */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.results-grid .total-section {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 1rem;
}

.results-grid .total-section .total-count {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937; /* Darker for better contrast */
}

.results-grid .total-section .total-label {
    font-size: 0.875rem;
    color: #4b5563; /* Darker for better contrast */
}

.results-grid .side-section {
    text-align: center;
}

.results-grid .side-count {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.results-grid .side-label {
    font-size: 0.875rem;
    color: #4b5563; /* Darker for better contrast */
    margin-bottom: 0.25rem;
}

.results-grid .side-percent {
    font-size: 1.25rem;
    font-weight: 600;
}

.results-grid .dub-section .side-count,
.results-grid .dub-section .side-percent {
    color: #3b82f6;
}

.results-grid .sub-section .side-count,
.results-grid .sub-section .side-percent {
    color: #10b981;
}

/* Enhanced Results Display with Count-up Animations */
.results-grid .side-count,
.results-grid .total-count {
    transition: all 0.3s ease;
    animation: countUpPulse 0.1s ease-out;
}

@keyframes countUpPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Compact Progress Bar */
.progress-container {
    margin: 1.5rem 0;
}

.progress-container h3 {
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.75rem;
    color: #1f2937; /* Darker for better contrast */
}

.progress-bars {
    display: flex;
    height: 16px; /* Increased height for padding */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1px 0; /* Top and bottom padding */
}

#dubBar, #subBar {
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth easing for progress bars */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

#dubBar {
    background: #3b82f6; /* Blue pill color */
}

#subBar {
    background: #ef4444; /* Red pill color - not scary red */
}

/* Cast Your Vote Button with Pop Shine Effect */
.cast-vote-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.cast-vote-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.cast-vote-button:active {
    transform: translateY(0) scale(0.98);
}

/* Pop Shine Effect */
.cast-vote-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.cast-vote-button:hover::before {
    left: 100%;
}

.button-icon {
    font-size: 1.2em;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Compact Status Section */
.status-section {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem 0; /* Added vertical padding */
}

.status-section .status-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937; /* Darker for better contrast */
    margin-bottom: 0.5rem;
}

.status-section .status-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #6366f1;
    padding: 0.75rem 1.5rem; /* Added horizontal and vertical padding */
    background: rgba(255, 255, 255, 0.1); /* Subtle background highlight */
    border-radius: 12px; /* Rounded corners */
    display: inline-block; /* Ensure padding is applied */
    min-width: 120px; /* Ensure minimum width for better proportions */
    animation: statusFadeIn 0.8s ease-out;
}

/* Status value animation */
@keyframes statusFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced button hover effects */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

/* Loading spinner enhancement */
#loadingSpinner {
    backdrop-filter: blur(5px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    /* Ensure full viewport coverage for videos */
    #backgroundMedia video {
        width: 100vw;
        height: 100vh;
        object-fit: cover;
    }
    
    /* Compact header with more top padding */
    header {
        padding: 6rem 1rem 1.5rem 1rem; /* Adjusted for mobile */
    }
    
    /* Bottom sign-in section on mobile with better contrast */
    #signInSection {
        padding: 1.25rem;
        background: rgba(255, 255, 255, 0.85) !important; /* Increased opacity for better contrast */
    }
    
    /* Compact voting and results sections with better contrast */
    #votingSection,
    #resultsSection {
        margin: 0 0.75rem 1rem 0.75rem;
        padding: 1.25rem;
        background: rgba(255, 255, 255, 0.85) !important; /* Increased opacity for better contrast */
    }
    
    /* Compact voting buttons with flat design */
    .vote-button {
        min-height: 70px;
        min-width: 120px;
        border-radius: 18px; /* Slightly smaller radius for mobile */
    }
    
    .vote-text {
        font-size: 1.25rem;
    }
    
    .vote-subtitle {
        font-size: 0.7rem;
        color: #ffffff; /* Pure white color */
        font-style: italic; /* Italic text */
    }
    

    
    /* Compact results */
    .results-grid {
        gap: 0.75rem;
    }
    
    .results-grid .side-count {
        font-size: 1.25rem;
    }
    
    .results-grid .side-percent {
        font-size: 1rem;
    }
    
    /* Compact progress bars */
    .progress-bars {
        height: 14px; /* Adjusted for mobile while maintaining padding */
    }
    
    #dubBar, #subBar {
        font-size: 0.625rem;
    }
}

/* Focus states for accessibility */
button:focus, a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Backdrop blur effects */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Glass morphism effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Specific text color overrides for better contrast */
.text-gray-800 {
    color: #1f2937 !important;
}

.text-gray-700 {
    color: #374151 !important;
}

.text-gray-600 {
    color: #4b5563 !important;
}

.text-gray-500 {
    color: #6b7280 !important;
}

/* Vote Result Section Text Contrast */
#voteResult .bg-gray-50\/80 {
    background: rgba(249, 250, 251, 0.95) !important; /* Increased opacity for better contrast */
}

#voteResult .text-gray-600 {
    color: #4b5563 !important; /* Darker for better contrast */
}

