/* Pikaday Calendar - Newspaper Style for The Baseball Herald */

/* Calendar Icon Trigger */
.calendar-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px 10px;
    border: none;
    background: transparent;
    font-family: 'Times New Roman', Times, serif;
}

.calendar-trigger:hover {
    background: transparent;
}

.calendar-trigger:focus {
    outline: none;
    background: transparent;
}

/* Simple black calendar icon made with CSS */
.calendar-icon {
    width: 16px;
    height: 16px;
    border: 1px solid #000;
    background: transparent;
    position: relative;
    display: inline-block;
}

.calendar-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 2px;
    right: 2px;
    height: 2px;
    background: #000;
}

.calendar-icon::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 2px;
    right: 2px;
    height: 1px;
    background: #000;
    box-shadow: 0 3px 0 #000, 0 6px 0 #000;
}

/* Hide Pikaday initially */
.pika-single.is-hidden {
    display: none;
}

/* Main Calendar Container - Newspaper Style */
.pika-single {
    z-index: 9999 !important;
    display: none; /* Hidden by default */
    position: absolute !important;
    color: #000;
    background: #f8f6f0 !important; /* Match site background */
    border: 2px solid #000 !important; /* Strong black border */
    border-radius: 0 !important; /* No rounded corners */
    font-family: 'Times New Roman', Times, serif !important;
    box-shadow: none !important; /* No modern shadows */
    width: auto !important;
    height: auto !important;
}

.pika-single.is-bound {
    position: absolute !important;
}

/* Force visibility when not hidden */
.pika-single:not(.is-hidden) {
    display: block !important;
}

/* Calendar Table */
.pika-single .pika-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #000;
}

.pika-single .pika-table th,
.pika-single .pika-table td {
    padding: 0;
    border: 1px solid #ccc;
    text-align: center;
}

.pika-single .pika-table th {
    background: #f0f0f0;
    font-weight: bold;
    padding: 8px 0;
    font-size: 0.9rem;
    color: #000;
}

/* Calendar Header (Month/Year) */
.pika-title {
    position: relative;
    text-align: center;
    background: #f8f6f0; /* Match site background */
    padding: 10px 40px; /* Extra padding for nav buttons */
    border-bottom: 1px solid #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pika-label {
    display: inline-block;
    position: relative;
    z-index: 9999;
    overflow: hidden;
    margin: 0 5px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #000;
    text-align: center;
}

.pika-title select {
    cursor: pointer;
    position: absolute;
    z-index: 9998;
    margin: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    font-family: 'Times New Roman', Times, serif;
}

/* Navigation Buttons */
.pika-prev,
.pika-next {
    display: block;
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    padding: 0;
    background: transparent;
    border: none;
    font: inherit;
    font-weight: bold;
    color: #000;
    text-decoration: none;
    font-size: 0.8rem;
    text-align: center;
    line-height: 30px;
    overflow: hidden;
    white-space: nowrap;
}

.pika-prev:hover,
.pika-next:hover {
    background: #f0f0f0;
}

.pika-prev {
    left: 5px;
}

.pika-next {
    right: 5px;
}

.pika-prev.is-disabled,
.pika-next.is-disabled {
    cursor: default;
    color: #999;
}

.pika-prev.is-disabled:hover,
.pika-next.is-disabled:hover {
    background: transparent;
}

/* Use symbols instead of text for navigation */
.pika-prev:before {
    content: "‹";
    font-size: 1.2rem;
    color: #000 !important;
    text-indent: 0 !important;
    display: block;
    width: 100%;
    height: 100%;
    line-height: 30px;
    text-align: center;
}

.pika-next:before {
    content: "›";
    font-size: 1.2rem;
    color: #000 !important;
    text-indent: 0 !important;
    display: block;
    width: 100%;
    height: 100%;
    line-height: 30px;
    text-align: center;
}

/* Hide the text content */
.pika-prev,
.pika-next {
    text-indent: -9999px;
    position: absolute;
    overflow: hidden;
}

/* Ensure proper positioning */
.pika-prev {
    left: 5px;
}

.pika-next {
    right: 5px;
}

/* Calendar Day Buttons */
.pika-single .pika-button {
    cursor: pointer;
    display: block;
    width: 100%;
    height: 30px;
    margin: 0;
    padding: 0;
    color: #000;
    font-size: 0.9rem;
    font-family: 'Times New Roman', Times, serif;
    line-height: 30px;
    text-align: center;
    background: #fff;
    border: none;
    outline: none;
}

.pika-single .pika-button:hover {
    background: #f0f0f0;
}

/* Today */
.pika-single .is-today .pika-button {
    font-weight: bold;
    background: #e8e8e8;
}

/* Selected Date */
.pika-single .is-selected .pika-button {
    background: #333;
    color: #fff;
    font-weight: bold;
}

/* Disabled Dates */
.pika-single .is-disabled .pika-button {
    color: #999;
    cursor: default;
    background: #f5f5f5;
}

.pika-single .is-disabled .pika-button:hover {
    background: #f5f5f5;
}

/* Days from other months */
.pika-single .is-outside-current-month .pika-button {
    color: #ccc;
}

.pika-single .is-selection-disabled {
    background: #f5f5f5;
}

.pika-single .is-selection-disabled .pika-button {
    color: #999;
    cursor: default;
}

.pika-single .is-selection-disabled .pika-button:hover {
    background: #f5f5f5;
}

/* Week numbers (if enabled) */
.pika-single .pika-week {
    font-size: 0.8rem;
    color: #999;
}

/* Remove any modern styling */
.pika-single * {
    box-sizing: border-box;
}

/* Position adjustments for bound calendars */
.pika-single.is-bound {
    margin-top: 5px;
}

/* Center the calendar trigger in the date picker section */
.date-picker-section .date-picker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.date-picker-section .current-date-display {
    text-align: center;
    margin-bottom: 0;
}

.date-picker-section .calendar-trigger {
    margin-top: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .pika-single {
        font-size: 0.9rem;
    }
    
    .pika-single .pika-button {
        height: 35px;
        line-height: 35px;
        font-size: 0.85rem;
    }
    
    .pika-title {
        padding: 8px;
    }
    
    .calendar-icon {
        font-size: 1.1rem;
    }
}