/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-y: auto;
    /* Allow scroll for dashboards */
}

/* Feed Container - The Scroll Snap Parent */
.feed-container {
    height: 100vh;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* Video Card - The Scroll Snap Child */
.video-card {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Video Element */
.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the screen */
}

/* Overlay UI */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass to video for play/pause */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 30%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.info {
    margin-bottom: 20px;
    pointer-events: auto;
}

.info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.actions {
    position: absolute;
    right: 10px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsiveness & 16:9 Adaptation */
@media (max-width: 768px) {
    .dashboard-container {
        max-width: 100%;
        width: 95%;
        padding: 1rem;
        margin-top: 10px;
    }

    /* Force tables to scroll horizontally */
    .data-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Adjust Hero Search */
    .hero-search {
        padding: 20px 10px;
    }

    .hero-search input {
        width: 100%;
        font-size: 1rem;
    }

    /* Feed Improvements for Mobile */
    .video-card {
        height: 100vh;
        /* Ensure full viewport height */
    }

    /* Overlay UI Scaling */
    .actions {
        right: 5px;
        bottom: 70px;
        /* Lift up slightly for mobile nav bars */
        gap: 15px;
    }

    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .info {
        margin-bottom: 70px;
        /* Avoid overlapping with bottom text or navs */
        padding-left: 10px;
    }


    .info h3 {
        font-size: 1rem;
    }

    .info p {
        font-size: 0.9rem;
    }

    /* Responsive Forms */
    .form-container,
    .manage-container {
        width: 100%;
        padding: 1rem;
        margin: 10px auto;
    }

    input,
    select,
    textarea {
        max-width: 100%;
        box-sizing: border-box;
        /* Ensure padding doesn't overflow width */
    }

    /* FullCalendar Mobile Tweaks */
    .fc-toolbar-title {
        font-size: 1.2rem !important;
        /* Smaller title */
    }

    .fc-header-toolbar {
        flex-direction: column;
        /* Stack controls if needed */
        gap: 10px;
    }
}

/* Aspect Ratio Handling for Desktop vs Mobile */
@media (min-width: 1024px) {

    /* Limit feed width on huge screens to simulate mobile view or keeping aspect ratio manageable */
    .feed-container {
        max-width: 500px;
        /* TikTok styling usually centers a mobile-width feed */
        margin: 0 auto;
        border-left: 1px solid #333;
        border-right: 1px solid #333;
    }

    /* Ensure video covers the constrained container */
    .video-card {
        background: #000;
    }
}

/* =========================================
   Feed Navigation & Header (Moved from feed.html)
   ========================================= */
.feed-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    pointer-events: none;
    /* Let clicks pass through except on links */
}

.feed-nav a,
.feed-nav form {
    pointer-events: auto;
    color: white;
    text-decoration: none;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.feed-nav input {
    padding: 5px;
    border-radius: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding-left: 10px;
}

.feed-search-form {
    display: flex;
    align-items: center;
}

.feed-search-input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.feed-filter-select {
    padding: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    margin-left: 1px;
    cursor: pointer;
}

.feed-filter-select.first {
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}

.feed-filter-select.last {
    border-radius: 15px;
}

.feed-filter-select option {
    color: black;
}

/* =========================================
   Upload Sections (Dashboard & Band)
   ========================================= */
.upload-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.upload-card {
    flex: 1;
    background: #333;
    padding: 15px;
    border-radius: 8px;
}

/* =========================================
   Mobile Overrides (Max Width 768px)
   ========================================= */
@media (max-width: 768px) {

    /* Feed Header Adaptation */
    .feed-nav {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent);
        /* Darker for readability */
    }

    .feed-nav>div {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .feed-search-form {
        width: 100%;
        display: flex;
    }

    .feed-search-input {
        flex: 1;
        /* Input takes remaining space */
        min-width: 0;
    }

    /* Upload Row Stacking */
    .upload-row {
        flex-direction: column;
        gap: 15px;
    }

    /* Repertoire Add Song Stacking */
    .add-song-container {
        flex-direction: column;
        align-items: stretch;
    }

    .add-song-container>div,
    .add-song-container>form {
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .add-song-container input {
        width: 100%;
    }

    /* Search Page Responsive */
    .search-page {
        flex-direction: column;
        padding: 10px;
    }

    .filters-sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    .filter-group {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .filter-label {
        background: #333;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 0.9rem;
    }
}

/* =========================================
   Repertoire Page Specifics
   ========================================= */
.add-song-container {
    display: flex;
    gap: 10px;
    position: relative;
    /* On desktop, it stays flex row. Mobile override is above. */
}

/* =========================================
   Rating Stars (Global)
   ========================================= */
.rating-star {
    cursor: pointer;
    color: #555;
    /* Unselected */
    font-size: 1.2rem;
    transition: color 0.2s;
}

.rating-star.selected {
    color: gold;
}

.rating-star:hover {
    color: #ffd700;
}

.event-rating .rating-star {
    font-size: 1.5rem;
}

/* =========================================
   Global Header / Navbar
   ========================================= */
.navbar {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2000;
}

.nav-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar a {
    color: white;
    text-decoration: none;
}

.navbar .logo {
    font-size: 1.2rem;
    font-weight: bold;
}

@media (max-width: 900px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }

    .nav-group {
        flex-direction: column;
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .nav-group a,
    .nav-group button,
    .nav-group .cta-button {
        width: 100%;
        display: block;
        text-align: center;
        box-sizing: border-box;
    }
}

/* Notification Styles */
.notif-container {
    position: relative;
    cursor: pointer;
}

.notif-dropdown {
    display: none;
    position: absolute;
    top: 35px;
    right: 0;
    width: 300px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

@media (max-width: 900px) {
    .notif-dropdown {
        position: fixed;
        top: 20%;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 350px;
    }
}

/* =========================================
   Glow Button & Loading State
   ========================================= */
/* Basic glowing button */
.glow-btn,
.btn-primary,
button[type="submit"] {
    --glow-color: #7afcff;
    --glow-size: 12px;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    color: #fff;
    background: linear-gradient(90deg, #111827, #374151);
    cursor: pointer;
    position: relative;
    box-shadow: 0 0 var(--glow-size) rgba(122, 252, 255, 0.35);
    transition: transform 200ms ease, box-shadow 200ms ease;
    /* Ensure it overrides others */
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* soft lift + stronger glow on hover */
.glow-btn:hover,
.btn-primary:hover,
button[type="submit"]:hover,
.glow-btn:focus,
.btn-primary:focus,
button[type="submit"]:focus {
    transform: translateY(-3px);
    box-shadow: 0 0 calc(var(--glow-size) * 1.6) rgba(122, 252, 255, 0.6);
}

/* decorative blurred glow layer */
.glow-btn::before,
.btn-primary::before,
button[type="submit"]::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: inherit;
    background: radial-gradient(circle at center, var(--glow-color), transparent 35%);
    filter: blur(12px);
    opacity: 0.6;
    z-index: -1;
    transition: transform 300ms ease, opacity 200ms ease;
}

.glow-btn:hover::before,
.btn-primary:hover::before,
button[type="submit"]:hover::before {
    transform: scale(1.05);
    opacity: 1;
}

/* accessible focus style */
.glow-btn:focus,
.btn-primary:focus,
button[type="submit"]:focus {
    outline: 3px solid rgba(255, 255, 255, 0.06);
    outline-offset: 2px;
}

/* Loading Spinner */
.loader {
    width: 1.2em;
    height: 1.2em;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading .loader {
    margin-right: 0;
}

/* Flash Messages & Utilities */
.flash-message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: white;
}

.flash-success {
    background: #1DB954 !important;
}

.flash-error {
    background: #e61e4d !important;
}

.text-green {
    color: #4CAF50 !important;
}

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

/* Chat Styles */
.chat-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 2rem;
    height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
}

.chat-main {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    height: 100%;
    overflow: hidden;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    /* Ensures flex container can shrink and thus scroll */
}

/* Scrollbar Styling for visibility */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

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

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.message-sent {
    align-self: flex-end;
    background: #e61e4d;
    color: white;
}

.message-received {
    align-self: flex-start;
    background: #333;
    color: white;
}

.filter-btn-smart {
    border: 1px solid #e61e4d;
    color: #e61e4d;
    background: transparent;
}

.filter-btn-smart.active {
    background: #e61e4d;
    color: white;
}

/* Custom Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    padding: 15px 25px;
    border-radius: 8px;
    background: #222;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #1DB954;
}

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

.toast-success {
    border-left-color: #1DB954;
}

.toast-error {
    border-left-color: #e61e4d;
}

.toast-info {
    border-left-color: #2196F3;
}

/* Custom Confirm Modal */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 21000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.custom-confirm-modal {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #333;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.custom-confirm-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.confirm-btn-yes {
    flex: 1;
    background: #e61e4d;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

.confirm-btn-no {
    flex: 1;
    background: #333;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
}

/* Unified Dashboard Button (Pink) */
.dashboard-action-btn {
    background: #e61e4d;
    color: white !important;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    min-width: 180px;
    text-align: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(230, 30, 77, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 1rem;
    line-height: normal;
}

.dashboard-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(230, 30, 77, 0.6);
}

/* Widget Gradient Blue */
.widget-gradient-blue {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
    color: white;
}

/* =========================================
   GeoIP Language Overlay
   ========================================= */
.geoip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    /* Shown via JS */
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', sans-serif;
}

.geoip-card {
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: geoSlideUp 0.5s ease;
}

@keyframes geoSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.geoip-flag {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
}

.geoip-card h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 700;
}

.geoip-card p {
    color: #ccc;
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.5;
}

.geoip-btn-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.geoip-btn {
    padding: 16px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: 0.3s;
    text-decoration: none;
}

.geoip-btn-primary {
    background: #e61e4d;
    color: white;
}

.geoip-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.geoip-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(230, 30, 77, 0.4);
}