/* ============================================
   GEARGUARD CALENDAR STYLES
   ============================================ */

/* Modal Base Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    animation: modalSlideIn 0.3s ease;
    /* Solid background for readability */
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(15, 15, 30, 0.98) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.1);
}

/* Override glass-card for modals */
.modal-content.glass-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.98) 0%, rgba(15, 15, 30, 0.98) 100%);
    backdrop-filter: blur(20px);
}

.modal-content.glass-card:hover {
    transform: none;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--white);
}

.modal-date-display {
    font-size: 0.9rem;
    color: var(--gold);
    margin-top: 0.25rem;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: var(--danger);
    color: var(--danger);
}

.modal-small {
    max-width: 400px;
}

/* Calendar Main */
.calendar-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Calendar Controls */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
}

.calendar-controls h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--white);
    min-width: 200px;
    text-align: center;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-nav:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold);
}

.btn-today {
    background: var(--gold);
    border: none;
    color: var(--black);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-today:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* Calendar Container */
.calendar-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* Calendar Header (Day Names) */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba(255, 215, 0, 0.1);
}

.day-name {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* Calendar Day */
.calendar-day {
    min-height: 100px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.other-month {
    opacity: 0.3;
    cursor: default;
}

.calendar-day.today {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold);
}

.calendar-day.today .day-number {
    background: var(--gold);
    color: var(--black);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.has-overdue {
    background: rgba(255, 107, 107, 0.05);
}

.day-number {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 0.5rem;
}

/* Day Events */
.day-events {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
}

.event-dot.corrective {
    background: var(--danger);
}

.event-dot.preventive {
    background: var(--success);
}

.event-dot.overdue {
    animation: pulse 1.5s infinite;
}

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

.more-events {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.corrective {
    background: var(--danger);
}

.legend-dot.preventive {
    background: var(--success);
}

.legend-dot.overdue {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

/* Day Modal */
.day-requests {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.day-request-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 4px solid var(--gold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.day-request-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.day-request-item.overdue {
    border-left-color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
}

.day-request-item.priority-critical {
    border-left-color: var(--danger);
}

.day-request-item.priority-high {
    border-left-color: #ff9500;
}

.day-request-item.priority-medium {
    border-left-color: var(--gold);
}

.day-request-item.priority-low {
    border-left-color: var(--success);
}

.day-request-item .request-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.day-request-item .priority-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.priority-indicator.priority-critical { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.priority-indicator.priority-high { background: #ff9500; box-shadow: 0 0 8px #ff9500; }
.priority-indicator.priority-medium { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.priority-indicator.priority-low { background: var(--success); box-shadow: 0 0 8px var(--success); }

.day-request-item .request-type {
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 700;
}

.day-request-item .type-corrective {
    background: rgba(255, 107, 107, 0.2);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.day-request-item .type-preventive {
    background: rgba(78, 205, 196, 0.2);
    color: var(--success);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.day-request-item .request-info {
    flex: 1;
}

.day-request-item .request-info h4 {
    font-size: 0.95rem;
    color: var(--white);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.day-request-item .request-info p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.25rem;
}

.day-request-item .unassigned-line {
    color: rgba(255, 165, 0, 0.8);
}

.request-stage {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.stage-new {
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
}

.stage-in_progress {
    background: rgba(78, 205, 196, 0.2);
    color: var(--success);
}

.stage-repaired {
    background: rgba(128, 128, 128, 0.2);
    color: #888;
}

.empty-day {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-day span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Day Actions Bar */
.day-actions-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-gold {
    background: var(--gold);
    color: var(--black);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Delete Button */
.btn-delete-event {
    width: 32px;
    height: 32px;
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid var(--danger);
    border-radius: 6px;
    color: var(--danger);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-delete-event:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* Delete Confirmation Modal */
.delete-confirm-content {
    text-align: center;
    padding: 1.5rem;
}

.delete-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.delete-confirm-content h3 {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.delete-confirm-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.delete-event-name {
    color: var(--gold);
    font-weight: 600;
}

.delete-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--danger);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Create Event Form */
.create-event-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.create-event-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.create-event-form label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.create-event-form input,
.create-event-form select {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.9rem;
}

.create-event-form input:focus,
.create-event-form select:focus {
    border-color: var(--gold);
    outline: none;
}

.create-event-form select option {
    background: var(--dark-bg);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }

    .day-number {
        font-size: 0.75rem;
    }

    .day-name {
        padding: 0.5rem;
        font-size: 0.7rem;
    }

    .calendar-legend {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

