/* Custom Styles for Injection Scheduling Calculator */

:root {
    --primary-color: #3f6ad8;
    --primary-dark: #3055bc;
    --secondary-color: #6c757d;
    --light-bg: #f8f9fa;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    background-color: var(--light-bg);
    color: #343a40;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    padding-bottom: 2rem;
}

/* Header Styles */
header {
    margin-bottom: 1rem;
}

header h1 {
    color: var(--primary-color);
    font-weight: 600;
}

/* Logo and header alignment */
header .d-flex {
    max-width: 600px;
    margin: 0 auto;
}

header img {
    flex-shrink: 0;
}

/* Card Styling */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 500;
}

/* Form Styling */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border-color: #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(63, 106, 216, 0.25);
}

.form-label {
    font-weight: 500;
    color: #495057;
}

/* Button Styling */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Results Styling */
#resultCard {
    border-left: 4px solid var(--primary-color);
}

.alert-info {
    background-color: rgba(63, 106, 216, 0.1);
    border-color: rgba(63, 106, 216, 0.2);
    color: #343a40;
}

#earliestDate, #latestDate {
    font-weight: 500;
    color: var(--primary-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    header {
        margin-bottom: 1.5rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

/* Accessibility Improvements */
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(63, 106, 216, 0.25);
    border-color: var(--primary-color);
}

/* Focus visible outline for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Calendar Styling */
.calendar-month {
    flex: 0 0 auto;
    width: 100%;
    max-width: 300px;
}

.calendar-table {
    border-collapse: separate;
    border-spacing: 2px;
    table-layout: fixed;
    width: 100%;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.calendar-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    padding: 8px 0;
    font-size: 0.8rem;
}

.calendar-month-header {
    color: var(--primary-dark);
    font-weight: 600;
    text-align: center;
}

.calendar-day {
    height: 40px;
    width: 40px;
    padding: 0;
    position: relative;
    text-align: center;
    vertical-align: middle;
}

.day-number {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    width: 30px;
    margin: 0 auto;
    font-size: 0.85rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    cursor: default;
}

/* Fix for mobile calendar display */
td.calendar-day {
    height: 40px !important;
    width: 40px !important;
    padding: 5px !important;
}

.safe-date {
    background-color: #d4edda !important;
    color: #155724 !important;
    font-weight: 600 !important;
    border-radius: 50% !important;
    box-shadow: inset 0 0 0 2px #28a745 !important;
}

.earliest-date {
    background-color: #28a745 !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px #155724 !important;
    position: relative !important;
    z-index: 1 !important;
}

.latest-date {
    background-color: #28a745 !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px #155724 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Past Date Styling */
.past-safe-date {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: 600 !important;
    border-radius: 50% !important;
    box-shadow: inset 0 0 0 2px #dc3545 !important;
}

.past-earliest-date {
    background-color: #dc3545 !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px #721c24 !important;
    position: relative !important;
    z-index: 1 !important;
}

.past-latest-date {
    background-color: #dc3545 !important;
    color: white !important;
    font-weight: bold !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px #721c24 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Past Date Warning */
.past-date-warning {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Calendar Legend */
.calendar-legend {
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    border-radius: 50%;
}

.safe-date-legend {
    background-color: #d4edda;
    box-shadow: inset 0 0 0 2px #28a745;
}

.earliest-date-legend, .latest-date-legend {
    background-color: #28a745;
    box-shadow: 0 0 0 2px #155724;
}

.past-safe-date-legend {
    background-color: #f8d7da;
    box-shadow: inset 0 0 0 2px #dc3545;
}

.past-earliest-date-legend, .past-latest-date-legend {
    background-color: #dc3545;
    box-shadow: 0 0 0 2px #721c24;
}

.legend-text {
    color: #444;
}

/* Calendar Responsive Styles */
@media (min-width: 768px) {
    .calendar-month {
        width: auto;
        min-width: 250px;
    }
    
    #calendarContainer {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .calendar-month {
        width: 100%;
        max-width: none;
    }
    
    #calendarContainer {
        justify-content: center;
    }
    
    .calendar-table th, .calendar-table td {
        padding: 5px;
    }
    
    .legend-item {
        margin-right: 10px;
        margin-bottom: 8px;
    }
}
