/* Chrysian Calendar Styles - matches Atlas theme */

/* Year Navigation Controls */
.calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--brass-dark);
    box-shadow:
        inset 0 0 0 1px var(--brass),
        0 4px 8px rgba(0, 0, 0, 0.6);
}

.year-nav {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--brass-dark), var(--brass));
    color: var(--bg-primary);
    border: 2px solid var(--brass-light);
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        inset 0 1px 0 var(--brass-light),
        0 2px 4px rgba(0, 0, 0, 0.5);
}

.year-nav:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 var(--brass-light),
        0 4px 8px rgba(0, 0, 0, 0.6),
        var(--glow-brass);
}

.year-nav:active {
    transform: translateY(0);
}

.year-nav.today-btn {
    background: linear-gradient(135deg, #8b7500, #ffd700);
    border-color: #ffed4e;
    margin-top: 0.75rem;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.year-nav.year-jump {
    background: linear-gradient(135deg, var(--copper), var(--copper-patina));
    border-color: var(--copper-patina);
}

.year-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.year-nav:disabled:hover {
    transform: none;
    box-shadow: none;
}

.year-display {
    text-align: center;
}

.year-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.year-number {
    display: block;
    font-size: 3rem;
    color: var(--brass-light);
    font-family: 'Georgia', serif;
    text-shadow: var(--text-shadow-brass);
    animation: brass-glow 4s ease-in-out infinite alternate;
    cursor: pointer;
}

.year-number:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.2em;
}

.year-input {
    display: none;
    font-size: 3rem;
    color: var(--brass-light);
    font-family: 'Georgia', serif;
    text-shadow: var(--text-shadow-brass);
    background: var(--bg-tertiary);
    border: 2px solid var(--brass);
    text-align: center;
    width: 6ch;
    padding: 0.25rem;
    margin: 0 auto;
}

.year-input:focus {
    outline: none;
    border-color: var(--brass-light);
    box-shadow: 0 0 10px rgba(184, 134, 11, 0.4);
}

.year-display.editing .year-number {
    display: none;
}

.year-display.editing .year-input {
    display: block;
}

.year-suffix {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--brass-dark);
}

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

.legend-box {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.2);
}

.legend-box.holiday {
    background: var(--brass);
    border-color: var(--brass-light);
}

.legend-box.custom {
    background: var(--magic-purple);
    border-color: #c4a7ff;
}

.legend-box.historical {
    background: #ff69b4;
    border-color: #ffb6c1;
}

.legend-box.tide-called {
    background: var(--ocean-blue);
    border-color: #9fd0f0;
}

.legend-box.tide-unused {
    background: rgba(119, 176, 216, 0.3);
    border-style: dashed;
    border-color: var(--ocean-blue);
}

.legend-box.current {
    background: #ffd700;
    border: 2px solid #ffed4e;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.legend-box.weekend {
    background: var(--bg-wood);
    border-color: var(--brass-dark);
}

/* Stats */
.calendar-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--brass-dark);
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--brass-dark);
}

.stat-value {
    font-size: 2rem;
    color: var(--brass-light);
    font-weight: bold;
    text-shadow: var(--text-shadow-brass);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Missing Records Warning */
.calendar-warning {
    background: rgba(180, 40, 40, 0.3);
    border: 3px solid #cc3333;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #ffaaaa;
    font-size: 1.2rem;
    box-shadow:
        0 0 20px rgba(200, 50, 50, 0.4),
        inset 0 0 30px rgba(180, 40, 40, 0.2);
}

.calendar-warning strong {
    color: #ff6666;
    font-size: 1.4rem;
    display: block;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 100, 100, 0.5);
}

/* Span Container */
.span-container {
    margin-bottom: 2.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--brass-dark);
    padding: 1.5rem;
    box-shadow:
        inset 0 0 0 1px var(--brass),
        0 4px 8px rgba(0, 0, 0, 0.6);
}

.span-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--brass-dark);
}

.span-header h2 {
    font-size: 1.8rem;
    color: var(--brass-light);
    margin-bottom: 0.25rem;
    text-shadow: var(--text-shadow-brass);
}

.span-header .season {
    color: var(--ocean-blue);
    font-style: italic;
    font-size: 1rem;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 3px;
    margin-bottom: 1rem;
}

.day-header {
    background: var(--brass-dark);
    padding: 0.75rem 0.25rem;
    text-align: center;
    font-weight: bold;
    font-size: 0.7rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day-cell {
    background: var(--bg-tertiary);
    padding: 0.75rem 0.25rem;
    text-align: center;
    min-height: 80px;
    border: 1px solid var(--brass-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.day-cell:hover {
    background: var(--bg-wood);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), var(--glow-brass);
}

.day-cell.weekend {
    background: var(--bg-wood);
}

.day-cell.holiday {
    border: 2px solid var(--brass);
    background: rgba(184, 134, 11, 0.15);
}

.day-cell.current-day {
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.day-cell.has-custom-event {
    border-top: 3px solid var(--magic-purple);
}

.day-cell.has-historical-event {
    border-bottom: 3px solid #ff69b4;
}

.day-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.day-name {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.event {
    font-size: 0.55rem;
    color: var(--brass-light);
    margin-top: 0.2rem;
    font-weight: bold;
    line-height: 1.3;
}

.custom-event-marker {
    font-size: 0.55rem;
    color: var(--magic-purple);
    margin-top: 0.2rem;
    line-height: 1.3;
}

.historical-event-marker {
    font-size: 0.55rem;
    color: #ff69b4;
    margin-top: 0.2rem;
    line-height: 1.3;
}

/* Tide Days */
.tide-days {
    background: linear-gradient(135deg, rgba(119, 176, 216, 0.15) 0%, rgba(22, 64, 88, 0.3) 100%);
    padding: 1rem;
    border: 2px solid var(--ocean-blue);
    margin-top: 1rem;
}

.tide-days h3 {
    color: var(--ocean-blue);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.tide-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.tide-day {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 4px;
    text-align: center;
    border: 1px solid rgba(119, 176, 216, 0.5);
    transition: all 0.2s ease;
}

.tide-day.called {
    background: rgba(119, 176, 216, 0.3);
    border: 2px solid var(--ocean-blue);
    cursor: pointer;
}

.tide-day.called:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(119, 176, 216, 0.5);
}

.tide-day.called.has-custom-event {
    border-top: 3px solid var(--magic-purple);
}

.tide-day.called.has-historical-event {
    border-bottom: 3px solid #ff69b4;
}

.tide-day.unused {
    opacity: 0.4;
    border-style: dashed;
}

.tide-day .day-number {
    color: var(--ocean-blue);
    font-size: 1rem;
}

.tide-day .day-name {
    color: var(--text-secondary);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    border: 2px solid var(--brass);
    box-shadow:
        0 8px 32px rgba(184, 134, 11, 0.3),
        inset 0 0 0 1px var(--brass-dark);
}

.modal-content h3 {
    color: var(--brass-light);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    text-shadow: var(--text-shadow-brass);
}

#modal-day-info {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

#events-list {
    margin-bottom: 1.5rem;
}

.event-item {
    background: var(--bg-wood);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--brass);
}

.event-item.custom {
    border-left-color: var(--magic-purple);
}

.event-item.historical {
    border-left-color: #ff69b4;
}

.event-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.event-item-name {
    font-weight: bold;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.event-item-type {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(184, 134, 11, 0.3);
    color: var(--brass-light);
}

.event-item-type.custom {
    background: rgba(162, 123, 252, 0.3);
    color: var(--magic-purple);
}

.event-item-type.historical {
    background: rgba(255, 105, 180, 0.3);
    color: #ff69b4;
}

.event-item-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.no-events {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1.5rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--brass-dark), var(--brass));
    color: var(--bg-primary);
    border: 2px solid var(--brass-light);
    font-family: 'Georgia', serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-brass);
}

/* Event Links */
.event-link {
    color: var(--ocean-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

.event-link:hover {
    color: var(--brass-light);
    text-shadow: 0 0 5px var(--brass);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .tide-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .calendar-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .year-number,
    .year-input {
        font-size: 2.5rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .day-header {
        font-size: 0.6rem;
        padding: 0.5rem 0.15rem;
    }

    .day-cell {
        min-height: 70px;
        padding: 0.5rem 0.15rem;
    }

    .tide-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-legend {
        gap: 1rem;
    }

    .legend-item {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .day-cell {
        min-height: 60px;
    }

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

    .event, .custom-event-marker, .historical-event-marker {
        font-size: 0.5rem;
    }
}
