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

html {
    color-scheme: dark;
    background-color: #1a1a1a;
}

body {
    font-family: Arial, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1a1a 100%);
    background-color: #1a1a1a;
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #c82333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-screen p {
    margin-top: 20px;
    color: #888;
}

/* Error Screen */
.error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: #ff5252;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
    margin-bottom: 20px;
}

.error-screen h2 {
    color: #ff5252;
    margin-bottom: 10px;
}

/* Password Screen */
.password-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.password-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(10px);
}

.password-card h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.password-info {
    color: #c82333;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.password-hint {
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
}

.password-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.password-input-container input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
}

.password-input-container input:focus {
    outline: none;
    border-color: #c82333;
}

.password-input-container input.error {
    border-color: #ff5252;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.password-input-container input::placeholder {
    color: #666;
    letter-spacing: normal;
}

.password-toggle {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.password-error {
    color: #ff5252;
    font-size: 13px;
    margin-bottom: 16px;
}

.password-screen .submit-btn {
    margin-top: 8px;
}

/* Success Screen */
.success-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    margin-bottom: 20px;
}

.success-screen h2 {
    color: #4caf50;
    margin-bottom: 10px;
}

.success-note {
    color: #888;
    margin-top: 20px;
    font-size: 14px;
}

/* Main Form */
.main-form {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo-container {
    margin-bottom: 16px;
}

.header-logo {
    max-width: 150px;
    height: auto;
}

.musician-info, .month-info {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.label {
    color: #888;
}

.value {
    color: #c82333;
    font-weight: 600;
}

/* Instructions */
.instructions {
    background: rgba(200, 35, 51, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.instructions p {
    font-size: 14px;
    margin-bottom: 12px;
}

.legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.status-dot.available {
    background: #4caf50;
}

.status-dot.unavailable {
    background: #f44336;
}

.status-dot.partial {
    background: #ff9800;
}

/* Calendar */
.calendar-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.calendar-header {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #fff;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    padding: 8px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 45px;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
}

.calendar-day .day-number {
    font-size: 14px;
    font-weight: 500;
}

.calendar-day .day-indicator {
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.calendar-day.available {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4caf50;
}

.calendar-day.available .day-indicator {
    background: #4caf50;
}

.calendar-day.unavailable {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
}

.calendar-day.unavailable .day-indicator {
    background: #f44336;
}

.calendar-day.partial {
    background: rgba(255, 152, 0, 0.3);
    border: 2px solid #ff9800;
}

.calendar-day.partial .day-indicator {
    background: #ff9800;
}

.calendar-day.has-notes::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #c82333;
    border-radius: 50%;
}

/* Summary Section */
.summary-section {
    margin-bottom: 24px;
}

.summary-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
}

.availability-summary {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.empty-summary {
    color: #666;
    text-align: center;
    font-size: 14px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-date {
    font-weight: 500;
    min-width: 100px;
}

.summary-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.summary-status .status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.summary-status .status-badge.available {
    background: rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

.summary-status .status-badge.unavailable {
    background: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

.summary-status .status-badge.partial {
    background: rgba(255, 152, 0, 0.3);
    color: #ff9800;
}

.summary-times {
    font-size: 11px;
    color: #888;
}

.summary-notes {
    font-size: 11px;
    color: #c82333;
    font-style: italic;
}

/* Submit Section */
.submit-section {
    text-align: center;
}

.submit-btn {
    width: 100%;
    padding: 16px 32px;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(200, 35, 51, 0.4);
}

.submit-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.submit-note {
    font-size: 12px;
    color: #666;
    margin-top: 12px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1a1a 100%);
    border: 1px solid rgba(200, 35, 51, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.small {
    max-width: 350px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(200, 35, 51, 0.1);
    border-bottom: 1px solid rgba(200, 35, 51, 0.2);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-date {
    font-size: 16px;
    font-weight: 600;
    color: #c82333;
    margin-bottom: 20px;
    text-align: center;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid rgba(200, 35, 51, 0.2);
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-btn.primary {
    background: #c82333;
    border: none;
    color: #fff;
}

.modal-btn.primary:hover {
    background: #a71d2a;
}

/* Time Ranges */
.time-ranges-container label,
.notes-container label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #888;
}

.time-range-item {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.time-range-item input[type="time"] {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.time-range-item input[type="time"]:focus {
    outline: none;
    border-color: #c82333;
}

.time-range-item span {
    color: #666;
}

.time-range-item .remove-range {
    background: rgba(244, 67, 54, 0.2);
    border: none;
    color: #f44336;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
}

.time-range-item .remove-range:hover {
    background: rgba(244, 67, 54, 0.3);
}

.add-range-btn {
    width: 100%;
    padding: 10px;
    background: rgba(200, 35, 51, 0.1);
    border: 1px dashed rgba(200, 35, 51, 0.3);
    border-radius: 8px;
    color: #c82333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-range-btn:hover {
    background: rgba(200, 35, 51, 0.2);
}

/* Notes */
.notes-container {
    margin-top: 20px;
}

.notes-container textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.notes-container textarea:focus {
    outline: none;
    border-color: #c82333;
}

.notes-container textarea::placeholder {
    color: #666;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .main-form {
        padding: 16px;
    }

    header h1 {
        font-size: 20px;
    }

    .legend {
        flex-direction: column;
        gap: 8px;
    }

    .calendar-day {
        min-height: 40px;
    }

    .calendar-day .day-number {
        font-size: 12px;
    }
}

/* Tool Selector */
.tool-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-label {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

.tool-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tool-btn.active {
    background: rgba(200, 35, 51, 0.15);
    border-color: rgba(200, 35, 51, 0.4);
    color: #c82333;
}

.tool-btn .tool-icon {
    font-size: 14px;
}

.select-all-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.select-all-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.bulk-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.clear-all-btn {
    padding: 8px 16px;
    background: rgba(102, 102, 102, 0.3);
    border: 1px solid rgba(102, 102, 102, 0.5);
    border-radius: 6px;
    color: #ccc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-all-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    color: #f44336;
}

.tool-btn .status-dot {
    width: 10px;
    height: 10px;
}

/* Tool active cursor on calendar */
.calendar-days.tool-active .calendar-day:not(.empty) {
    cursor: crosshair;
}

.calendar-days.tool-active .calendar-day:not(.empty):hover {
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .tool-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tool-buttons {
        width: 100%;
    }

    .tool-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
    }

    .bulk-action-buttons {
        flex-direction: row;
    }

    .select-all-btn,
    .clear-all-btn {
        flex: 1;
        padding: 12px 16px;
    }
}

/* Progress Bar */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c82333 0%, #4caf50 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

/* Status Selection Popup */
.status-popup {
    position: fixed;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1a1a 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    min-width: 180px;
    overflow: hidden;
    border: 1px solid rgba(200, 35, 51, 0.2);
}

.status-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(200, 35, 51, 0.1);
    border-bottom: 1px solid rgba(200, 35, 51, 0.2);
}

.status-popup-header span {
    font-size: 13px;
    font-weight: 600;
    color: #c82333;
}

.popup-close {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.popup-close:hover {
    color: #fff;
}

.status-popup-options {
    display: flex;
    flex-direction: column;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.status-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.status-option.available:hover {
    background: rgba(76, 175, 80, 0.2);
}

.status-option.unavailable:hover {
    background: rgba(244, 67, 54, 0.2);
}

.status-option.partial:hover {
    background: rgba(255, 152, 0, 0.2);
}

.status-option.clear:hover {
    background: rgba(150, 150, 150, 0.2);
}

.status-dot.clear {
    background: #666;
}

/* Summary Delete Button */

.summary-item-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex: 1;
}

.summary-delete {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    transition: color 0.2s ease;
}

.summary-delete:hover {
    color: #f44336;
}

/* Validation Warning */
.validation-warning {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #ff9800;
}

.validation-warning ul {
    margin: 8px 0 0 20px;
}

.validation-warning li {
    margin: 4px 0;
}

/* Incomplete Partial Indicator */
.calendar-day.partial.incomplete {
    animation: pulse-warning 1.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 152, 0, 0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

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

/* Submission Loading Overlay */
.submission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.submission-overlay-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.submission-overlay-content .spinner.large {
    width: 70px;
    height: 70px;
    border-width: 5px;
    margin: 0 auto 30px;
}

.submission-overlay-content h2 {
    color: #ffffff;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.submission-message {
    color: #b0b0b0;
    font-size: 16px;
    margin-bottom: 20px;
}

.submission-warning {
    color: #ff9800;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 25px;
}

.submission-progress {
    margin-top: 20px;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.progress-dots .dot {
    width: 10px;
    height: 10px;
    background: #c82333;
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.progress-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.progress-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.progress-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
