/* Calendar Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #111827;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Main Calendar Content */
.calendar-main {
    flex: 1;
    padding: 0;
    margin-top: var(--header-height, 64px);
}

.calendar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Calendar Header */
.calendar-header {
    margin-bottom: 2rem;
}

.calendar-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.calendar-title i {
    color: #3b82f6;
    font-size: 1.75rem;
}

.calendar-subtitle {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.5;
}

/* Calendar Toolbar */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.calendar-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.calendar-btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.calendar-btn.primary:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.calendar-btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.calendar-btn.secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* Calendar Navigation */
.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.nav-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.current-period {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    min-width: 200px;
    text-align: center;
}

/* View Options */
.calendar-view-options {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 0.875rem;
}

.view-btn:hover {
    color: #374151;
}

.view-btn.active {
    background: white;
    color: #3b82f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Calendar Views Container */
.calendar-views {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.calendar-view {
    display: none;
    min-height: 600px;
}

.calendar-view.active {
    display: block;
}

/* Day View */
.day-view {
    padding: 1.5rem;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.day-date {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.day-events-count {
    color: #6b7280;
    font-size: 0.875rem;
}

.day-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

/* Week View */
.week-view {
    padding: 1.5rem;
}

.week-header {
    display: grid;
    grid-template-columns: 80px 1fr;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}


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

.week-day-header {
    text-align: center;
    padding: 0.75rem;
    font-weight: 600;
    color: #374151;
    background: #f8fafc;
}

.week-day-header.today {
    background: #eff6ff;
    color: #1d4ed8;
}

.week-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    min-height: 500px;
}

.time-slots {
    background: white;
}

.time-slot {
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.75rem;
    color: #6b7280;
    background: white;
}

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

.week-day-column {
    background: white;
    position: relative;
}

.week-hour-slot {
    height: 60px;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.week-hour-slot:hover {
    background: #f8fafc;
}

/* Month View */
.month-view {
    padding: 1.5rem;
}

.month-header {
    margin-bottom: 1rem;
}

.month-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.weekday {
    background: #f8fafc;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    min-height: 400px;
}

.month-day {
    background: white;
    min-height: 100px;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    border-bottom: 1px solid #f3f4f6;
}

.month-day:hover {
    background: #f8fafc;
}

.month-day.other-month {
    background: #f9fafb;
    color: #9ca3af;
}

.month-day.today {
    background: #eff6ff;
}

.month-day-number {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.month-day.today .month-day-number {
    color: #1d4ed8;
}

/* List View */
.list-view {
    padding: 1.5rem;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.list-filter {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.list-filter:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.list-content {
    min-height: 400px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.empty-state p {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Event Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Button Styles */
.btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn.primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.btn.primary:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn.secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn.danger {
    background: #ef4444;
    color: white;
}

.btn.danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Event Styles */
.event {
    background: #3b82f6;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.event:hover {
    background: #2563eb;
}

.event.maintenance {
    background: #f59e0b;
}

.event.inspection {
    background: #10b981;
}

.event.training {
    background: #8b5cf6;
}

.event.deadline {
    background: #ef4444;
}

.event.meeting {
    background: #3b82f6;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calendar-container {
        padding: 1.5rem;
    }
    
    .calendar-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .calendar-actions {
        justify-content: center;
    }
    
    .calendar-navigation {
        justify-content: center;
    }
    
    .calendar-view-options {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .calendar-container {
        padding: 1rem;
    }
    
    .calendar-title {
        font-size: 1.75rem;
        text-align: center;
    }
    
    .calendar-toolbar {
        padding: 1rem;
    }
    
    .calendar-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .calendar-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .week-grid {
        grid-template-columns: 60px 1fr;
    }
    
    .month-day {
        min-height: 80px;
        padding: 0.25rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .calendar-container {
        padding: 0.75rem;
    }
    
    .calendar-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .calendar-toolbar {
        padding: 0.75rem;
    }
    
    .calendar-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .current-period {
        font-size: 1rem;
        min-width: 150px;
    }
    
    .view-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .month-day {
        min-height: 60px;
        padding: 0.125rem;
        font-size: 0.75rem;
    }
    
    .week-grid {
        grid-template-columns: 50px 1fr;
    }
    
    .time-slot {
        height: 40px;
        font-size: 0.625rem;
    }
    
    .week-hour-slot {
        height: 40px;
    }
}

/* Print Styles */
@media print {
    .calendar-main {
        margin-top: 0;
    }
    
    .calendar-toolbar {
        display: none;
    }
    
    .calendar-view {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .modal {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .calendar-view,
    .calendar-toolbar {
        border: 2px solid #000000;
    }
    
    .calendar-btn.primary,
    .btn.primary {
        background: #000000;
        color: #ffffff;
    }
    
    .event {
        border: 1px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .calendar-btn,
    .btn,
    .nav-btn,
    .view-btn,
    .week-hour-slot,
    .month-day {
        transition: none;
    }
    
    .modal-content {
        animation: none;
    }
    
    .btn.primary:hover,
    .btn.danger:hover {
        transform: none;
    }
} 