/**
 * Styling untuk Kalender Jawa
 * Responsive design dengan grid layout
 */

/* Container utama kalender */
.kalender-jawa-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Informasi hari ini */
.kalender-today-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.kalender-today-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
}

.today-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-label {
    font-weight: 500;
    opacity: 0.9;
}

.info-value {
    font-weight: 700;
    font-size: 1.05em;
}

.weton-highlight {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Header kalender dengan navigasi */
.kalender-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.kalender-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.nav-button:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.nav-arrow {
    font-size: 1.2em;
    font-weight: bold;
}

.current-month-year {
    text-align: center;
    flex: 2;
}

.current-month-year h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.8em;
    font-weight: 700;
}

.month-year-selectors {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.month-selector,
.year-selector {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.month-selector:focus,
.year-selector:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.go-button {
    padding: 8px 15px;
    background: #34a853;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.go-button:hover {
    background: #2d8f47;
    transform: translateY(-1px);
}

.today-button {
    padding: 12px 20px;
    background: #ea4335;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(234, 67, 53, 0.3);
}

.today-button:hover {
    background: #d33b2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.4);
}

/* Grid kalender */
.kalender-grid {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.kalender-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.day-header {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.day-header.minggu,
.day-header.sabtu {
    background: rgba(255, 255, 255, 0.1);
}

.kalender-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

/* Styling untuk setiap tanggal */
.kalender-date {
    background: white;
    min-height: 120px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

.kalender-date:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4285f4;
    z-index: 10;
}

.kalender-date.empty-date {
    background: #f8f9fa;
    cursor: default;
}

.kalender-date.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.kalender-date.today .date-number {
    color: white;
    font-weight: 700;
}

.kalender-date.today .weton {
    color: #ffd700;
}

.date-number {
    font-size: 1.4em;
    font-weight: 600;
    color: #333;
    padding: 10px;
    text-align: center;
    background: rgba(0,0,0,0.02);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.date-info {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weton {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.85em;
    color: #4285f4;
    background: rgba(66, 133, 244, 0.1);
    padding: 4px 6px;
    border-radius: 4px;
}

.additional-info {
    font-size: 0.7em;
    color: #666;
    line-height: 1.3;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.kalender-date:hover .additional-info {
    opacity: 1;
}

.additional-info div {
    margin: 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover overlay */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 10px;
    z-index: 5;
}

.kalender-date:hover .hover-overlay {
    opacity: 1;
    visibility: visible;
}

.detailed-info {
    text-align: center;
    line-height: 1.6;
    font-size: 0.85em;
}

/* Loading indicator */
.kalender-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* Legend */
.kalender-legend {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.kalender-legend h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.today-color {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.weekend-color {
    background: #ea4335;
}

.legend-text-only {
    color: #555;
}

/* Modal */
.date-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px 25px;
}

/* Responsive design */
@media (max-width: 768px) {
    .kalender-jawa-wrapper {
        padding: 15px;
        margin: 10px;
    }
    
    .today-info-grid {
        grid-template-columns: 1fr;
    }
    
    .kalender-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .kalender-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
    
    .current-month-year h2 {
        font-size: 1.5em;
    }
    
    .kalender-dates {
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
    }
    
    .kalender-date {
        min-height: 80px;
        font-size: 0.8em;
    }
    
    .date-number {
        font-size: 1.2em;
        padding: 6px;
    }
    
    .date-info {
        padding: 4px;
    }
    
    .weton {
        font-size: 0.7em;
        padding: 2px 4px;
    }
    
    .additional-info {
        font-size: 0.6em;
        display: none;
    }
    
    .kalender-date:hover .additional-info {
        display: block;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kalender-jawa-wrapper {
        padding: 10px;
        margin: 5px;
    }
    
    .kalender-date {
        min-height: 60px;
    }
    
    .date-number {
        font-size: 1em;
        padding: 4px;
    }
    
    .weton {
        font-size: 0.6em;
        flex-direction: column;
        align-items: center;
        gap: 0;
    }
    
    .hover-overlay {
        position: relative;
        opacity: 1;
        visibility: visible;
        background: rgba(0, 0, 0, 0.7);
        font-size: 0.7em;
    }
}

/* Print styles */
@media print {
    .kalender-navigation,
    .today-button,
    .kalender-legend,
    .hover-overlay {
        display: none !important;
    }
    
    .kalender-jawa-wrapper {
        box-shadow: none;
        background: white;
    }
    
    .kalender-grid {
        box-shadow: none;
    }
    
    .kalender-date {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        transform: none !important;
    }
}

/* Animasi smooth untuk transisi */
.kalender-jawa-wrapper * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom scrollbar */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}