/* Custom styles for D&D Session Scheduler - Dark Theme */

/* Campaign accent */
:root {
    --campaign-accent: #0d6efd;
    --campaign-accent-hover: #0a58ca;
}

.campaign-navbar {
    background-color: var(--campaign-accent) !important;
}

.campaign-title {
    color: var(--campaign-accent);
    font-weight: 600;
}

/* General styles */
body {
    background-color: #212529;
    color: #f8f9fa;
}

/* Calendar customization */
.fc {
    background-color: #343a40;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Dark theme overrides */
.fc-theme-standard td,
.fc-theme-standard th {
    border-color: #495057;
}

.fc-theme-standard .fc-scrollgrid {
    border-color: #495057;
}

.fc-col-header-cell {
    background-color: #212529;
    color: #f8f9fa;
    border-color: #495057;
}

.fc-day-today {
    background-color: #2c3338 !important;
}

.fc-button-primary {
    background-color: #495057 !important;
    border-color: #6c757d !important;
}

.fc-button-primary:hover {
    background-color: #6c757d !important;
    border-color: #495057 !important;
}

.fc-toolbar-title {
    text-transform: capitalize;
}

/* Event styles */
.fc-event {
    cursor: pointer;
    padding: 4px;
    margin: 2px 0;
    color: #f8f9fa !important;
}

.event-potential {
    background-color: var(--campaign-accent) !important;
    border-color: var(--campaign-accent) !important;
}

.event-empty {
    background-color: #343a40 !important;
    border-color: #f8f9fa !important;
}

.event-locked {
    background-color: #157347 !important;
    border-color: #157347 !important;
}

/* Modal customization */
.modal-content {
    background-color: #343a40;
    color: #f8f9fa;
}

.modal-header {
    background-color: #212529;
    border-bottom: 1px solid #495057;
}

.modal-footer {
    background-color: #212529;
    border-top: 1px solid #495057;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Desktop modal adjustments */
@media (min-width: 769px) {
    .modal-dialog {
        max-width: 800px; /* Increased from default 500px */
        width: 80%; /* Use percentage of screen width */
        margin-top: 4px; /* Reduced from default 1.75rem (28px) */
        margin-bottom: 4px; /* Reduced bottom margin as well */
    }
    
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .modal-body-flex {
        display: flex;
        flex-direction: row;
        gap: 30px;
    }
    
    .voters-section {
        flex: 3; /* Give more space to voters section */
        min-width: 0; /* Allow flex item to shrink below content size */
    }
    
    .pizza-section {
        flex: 2; /* Give less space to pizza section */
        border-left: 1px solid #495057;
        padding-left: 30px;
        min-width: 0; /* Allow flex item to shrink below content size */
    }
}

/* Form controls dark theme */
.form-control, .form-select {
    background-color: #2c3338;
    border-color: #495057;
    color: #f8f9fa;
}

.form-control:focus, .form-select:focus {
    background-color: #2c3338;
    border-color: var(--campaign-accent);
    color: #f8f9fa;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Voters list styling */
#votersList {
    max-height: 600px;
    overflow-y: auto;
}

/* This is now handled by the animation definition below */
.voter-item {
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}


.voter-available {
    border-left: 4px solid #157347;
}

.voter-unavailable {
    border-left: 4px solid #bb2d3b;
}

.voter-no-vote {
    border-left: 4px solid #ffffff;
}

/* List view styles */
.fc-list-event {
    cursor: pointer;
}

/* Style the event dots in list view */
.fc-list-event-dot {
    display: none !important;
}

.event-locked .fc-list-event-time::before,
.event-potential .fc-list-event-time::before,
.event-empty .fc-list-event-time::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.event-locked .fc-list-event-time::before {
    background-color: #157347;
}

.event-potential .fc-list-event-time::before {
    background-color: #0b5ed7;
}

.event-empty .fc-list-event-time::before {
    background-color: #343a40;
    border: 1px solid #f8f9fa;
}

/* Remove blue underline from dates globally */
.fc a {
    color: inherit;
    text-decoration: none !important;
}

.fc-list-day-text,
.fc-list-day-side-text {
    color: #f8f9fa !important;
    text-decoration: none !important;
}

.fc-list-day-cushion {
    background-color: #212529 !important;
}

.fc-list-event:hover td {
    background-color: #495057 !important;
}

.fc-theme-standard .fc-list-day > th {
    background-color: #212529 !important;
    border-color: #495057 !important;
}

.fc-theme-standard .fc-list {
    border-color: #495057 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
    }
    
    .fc-toolbar-chunk {
        margin: 4px 0;
    }
    
    #campaignSelect,
    #userSelect {
        width: 100% !important;
        margin: 8px 0;
    }

    /* Larger touch targets for mobile */
    .fc-event {
        padding: 8px;
        margin: 4px 0;
        min-height: 44px;
    }

    .fc a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fc-list-event td {
        padding: 16px !important;
    }

    .fc-list-event-title,
    .fc-list-event-time {
        font-size: 16px;
    }

    .fc-list-day-cushion {
        padding: 12px !important;
    }

    .fc-list-event.event-locked {
        background-color: rgba(21, 115, 71, 0.7) !important;
    }

    .fc-list-event.event-potential {
        background-color: rgba(11, 94, 215, 0.7) !important;
    }

    /* Full-width modals on mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .modal-content {
        border-radius: 0;
        min-height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .modal-body {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 220px; /* Further increased space for DM view with 3 buttons */
    }
    
    /* Fixed footer for mobile */
    .modal-footer.fixed-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: #212529;
        border-top: 1px solid #495057;
        z-index: 1050;
        padding: 10px;
        display: flex;
        justify-content: space-between;
    }

    /* Larger buttons in modals */
    .modal-footer .btn {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
        margin: 4px 0;
    }

    /* Better spacing for voter list */
    .voter-item {
        padding: 12px;
        margin: 8px 0;
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .campaign-navbar .container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .campaign-navbar .campaign-brand {
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .campaign-navbar .campaign-brand .btn {
        width: auto;
    }

    .campaign-navbar .campaign-controls {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .campaign-navbar .campaign-controls .btn {
        width: 100%;
    }
}

/* Loading indicator */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #495057;
    border-top: 2px solid #0b5ed7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Add Date FAB */
.add-date-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--campaign-accent);
    color: #f8f9fa;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-date-fab:hover {
    background-color: var(--campaign-accent-hover);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    background-color: #343a40;
    color: #f8f9fa;
    margin-bottom: 10px;
    border: 1px solid #495057;
}

/* Pizza voting styles */
.voter-pizza-yes {
    color: #28a745;
    padding: 2px 0;
}

.voter-pizza-no {
    color: #dc3545;
    padding: 2px 0;
}

.voter-pizza-no-vote {
    color: #6c757d;
    padding: 2px 0;
}

#pizzaVotingSection {
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

#pizzaVotingSection h5, #pizzaVotingSection h6 {
    color: #ff9800;
}

/* Pizza vote buttons */
#votePizzaYes.active, #votePizzaNo.active {
    border-width: 2px;
    font-weight: bold;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

#votePizzaYes.active {
    background-color: #157347;
    border-color: #146c43;
}

#votePizzaNo.active {
    background-color: #bb2d3b;
    border-color: #b02a37;
}

/* PWA installation prompt */
#pwaPrompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #343a40;
    color: #f8f9fa;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 1000;
    border-top: 1px solid #495057;
}

/* Vote Status Icons */
.vote-status-icon {
    width: 20px;  /* Set a fixed width */
    height: 20px; /* Set a fixed height */
    vertical-align: text-bottom; /* Align better with the text */
    margin-left: 5px;
}

.vote-available {
    color: #198754; /* Bootstrap success green */
}

.vote-unavailable {
    color: #dc3545; /* Bootstrap danger red */
}
