/* Kalender Publikasi CSS */

/* Calendar Container */
.calendar-page {
    background: #f5f7fa;
    min-height: 100vh;
}

/* Header Styling */
.calendar-header {
    background: #F8F8F8;
    color: #333;
    padding: 60px 0 40px 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.calendar-header h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333 !important;
    text-shadow: none;
}

.calendar-header p {
    font-size: 18px;
    color: #666 !important;
    opacity: 1;
    text-shadow: none;
}

/* Calendar Container */
.calendar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Calendar Controls */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.calendar-controls h2 {
    margin: 0;
    font-size: 28px;
    color: #333;
    font-weight: 700;
}

/* Navigation Buttons */
.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    background: #CC3334;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.calendar-nav button:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

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

/* Next/Prev Month Buttons - Ensure both are red */
#prevMonth, #nextMonth {
    background: #CC3334 !important;
    color: white !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prevMonth:hover, #nextMonth:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

#prevMonth:active, #nextMonth:active {
    transform: translateY(0);
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    padding: 5px;
    border-radius: 8px;
}

.view-toggle button {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.view-toggle button.active {
    background: #CC3334;
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.view-toggle button:hover:not(.active) {
    background: rgba(239, 68, 68, 0.1);
    color: #CC3334;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.filter-wrapper{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
}

.filter-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: #CC3334;
    color: #CC3334;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #CC3334;
    color: white;
    border-color: #CC3334;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Filter Button Specific Colors */
.filter-btn[data-filter="publikasi"].active {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.filter-btn[data-filter="publikasi"]:hover:not(.active) {
    border-color: #28a745;
    color: #28a745;
}

.filter-btn[data-filter="batal"].active {
    background: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.filter-btn[data-filter="batal"]:hover:not(.active) {
    border-color: #dc3545;
    color: #dc3545;
}

/* Search Box */
.search-box {
    width: 300px;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #CC3334;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
} */

/* Day Headers */
.calendar-day-header {
    background: #CC3334;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Calendar Day Cells */
.calendar-day {
    background: white;
    height: 120px; /* Fixed height instead of min-height */
    min-height: 120px;
    max-height: 120px;
    padding: 12px;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden; /* Hide overflow content */
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.calendar-day.other-month {
    background: #fafafa;
    opacity: 0.5;
}

.calendar-day.other-month:hover {
    background: #f5f5f5;
}

/* Today Highlight */
.calendar-day.today {
    background: #fff3cd !important;
    border: 2px solid #CC3334;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.calendar-day.today .day-number {
    color: #CC3334;
    font-weight: 900;
    font-size: 18px;
}

.calendar-day.today:hover {
    background: #fff3cd !important;
    transform: scale(1.02);
}

/* Day Number */
.day-number {
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
    flex-shrink: 0; /* Don't shrink */
}

.calendar-day.other-month .day-number {
    color: #999;
}

/* Publication Items */
.publication-item {
    font-size: 10px;
    padding: 4px 6px;
    margin-bottom: 3px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    font-weight: 600;
    display: block; /* Changed from flex to block for better ellipsis */
    line-height: 1.2;
    max-width: 100%;
    flex-shrink: 0; /* Don't shrink */
}

.publication-item::before {
    content: "● ";
    font-size: 8px;
}

.publication-item.publikasi {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.3);
}

.publication-item.berita {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #333;
    box-shadow: 0 2px 5px rgba(255, 193, 7, 0.3);
}

.publication-item.batal {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

.publication-item:hover {
    transform: translateX(3px) scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 100;
}

/* More Publications Indicator */
.more-publications {
    font-size: 10px;
    color: #CC3334;
    cursor: pointer;
    margin-top: 3px;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0; /* Don't shrink */
}

.more-publications:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* Today Highlight */
.calendar-day.today {
    background: #fff8e1;
    border: 2px solid #ffc107;
}

.calendar-day.today .day-number {
    color: #ffc107;
    font-weight: 900;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .calendar-container {
        padding: 15px;
    }
    
    .calendar-controls {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .calendar-header h1 {
        font-size: 32px;
    }
    
    .calendar-container {
        display: flex;
        flex-direction: column;
        padding: 15px;
    }
    
    /* Filter Section - PALING ATAS */
    .filter-wrapper{
        display:flex;
        flex-direction:column;
        gap:15px;
    }
    
    .filter-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .filter-btn {
        width: 100%;
        padding: 12px;
        font-size: 13px;
        justify-content: center;
    }
    
    .search-box {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px;
        margin: 0;
    }
    
    /* Calendar Controls - DI TENGAH */
    .calendar-controls {
        order: 2;
        flex-direction: column;
        padding: 15px;
        gap: 12px;
        display: flex;
        margin-bottom: 15px;
    }
    
    .calendar-nav {
        width: 100%;
        gap: 8px;
        display: flex;
    }
    
    .calendar-nav button {
        flex: 1;
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .calendar-controls h2 {
        font-size: 22px;
        text-align: center;
        margin: 0;
        order: 2;
    }
    
    .view-toggle {
        width: 100%;
        gap: 6px;
        padding: 6px;
        display: flex;
        order: 3;
    }
    
    .view-toggle button {
        flex: 1;
        padding: 10px 6px;
        font-size: 12px;
    }
    
    #prevMonth,
    #nextMonth {
        padding: 10px !important;
        font-size: 13px;
        flex: 0 0 auto;
    }
    
    /* Calendar Grid - PALING BAWAH */
    .calendar-grid {
        order: 3;
        gap: 1px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 8px;
    }
    
    .calendar-day-header {
        padding: 10px 5px;
        font-size: 11px;
    }
    
    .publication-item {
        font-size: 9px;
        padding: 3px 5px;
    }
    
    /* List View - PALING BAWAH */
    .list-view {
        order: 3;
    }
    
    /* Year View - PALING BAWAH */
    .year-view {
        order: 3;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .calendar-header h1 {
        font-size: 24px;
    }
    
    .filter-buttons {
        grid-template-columns: 1fr;
    }
    
    .filter-btn {
        padding: 10px;
        font-size: 12px;
    }
    
    .search-box {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .calendar-controls h2 {
        font-size: 20px;
    }
    
    .calendar-nav button,
    .view-toggle button,
    #prevMonth,
    #nextMonth {
        font-size: 12px;
        padding: 10px !important;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-day {
    animation: fadeIn 0.3s ease-out;
}

/* Loading State */
.calendar-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.calendar-loading::after {
    content: "";
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #CC3334;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* List View Styles */
.list-view {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.publication-table {
    width: 100%;
    border-collapse: collapse;
}

.publication-table thead {
    background: #CC3334;
    color: white;
}

.publication-table th {
    padding: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.publication-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.publication-table tbody tr:hover {
    background: #f8f9fa;
}

.publication-table td {
    padding: 15px;
    vertical-align: middle;
}

.pub-title {
    font-weight: 600;
    color: #333;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
}

.badge-publikasi {
    background: #28a745;
    color: white;
}

.badge-berita {
    background: #ffc107;
    color: #333;
}

.status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.btn-detail {
    display: inline-block;
    padding: 8px 16px;
    background: #CC3334;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-detail:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-data i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-data p {
    font-size: 18px;
    margin: 0;
}

/* Year View Styles */
.year-view {
    display: block;
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.month-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

.month-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.month-card-header {
    background: #CC3334;
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
}

.month-card-body {
    padding: 30px;
    text-align: center;
}

.pub-count {
    font-size: 48px;
    font-weight: 700;
    color: #CC3334;
    margin-bottom: 10px;
}

.pub-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Responsive for List and Year Views */
@media (max-width: 768px) {
    .publication-table {
        font-size: 12px;
    }
    
    .publication-table th,
    .publication-table td {
        padding: 10px 5px;
    }
    
    .pub-title {
        font-size: 13px;
    }
    
    .year-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .month-card-body {
        padding: 20px;
    }
    
    .pub-count {
        font-size: 36px;
    }
}

/* Table Responsive Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.publication-table {
    width: 100%;
    min-width: 800px; /* Force horizontal scroll on small screens */
    border-collapse: collapse;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .publication-table {
        font-size: 11px;
        min-width: 700px;
    }
    
    .publication-table th,
    .publication-table td {
        padding: 8px 5px;
        white-space: nowrap;
    }
    
    .pub-title {
        font-size: 12px;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .btn-detail {
        padding: 5px 10px;
        font-size: 11px;
    }
}