/* ============================================================================
  Mobile responsive key breakpoints.
   ============================================================================ */

   /* Tablet */
@media (max-width: 768px) {
    .topbar-container {
        flex-direction: column;
        padding: 12px;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; /* Or make it a dropdown */
    }
}

/* ============================================================================
   CALENDAR WIDGET - Sidebar Component
   Mobile-responsive calendar for scheduling view
   ============================================================================ */

.calendar-widget {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 300px; /* Prevent overflow */
    box-sizing: border-box;
}

/* Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-month-year {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.calendar-nav {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.calendar-nav:hover {
    background: #f0f0f0;
    color: #0077b5;
}

/* Legend */
.calendar-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 11px;
    color: #666;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-item .dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
}

/* Grid Container */
.calendar-grid {
    width: 100%;
    overflow: hidden; /* Prevent overflow */
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    padding: 4px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    width: 100%;
}

/* Days */
.day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: #fafbfc;
    padding: 2px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent content overflow */
}

.day:hover:not(.empty):not(.past) {
    background: #e3f2fd;
    transform: scale(1.05);
}

.day.empty {
    background: none;
    cursor: default;
}

.day.past {
    opacity: 0.4;
    cursor: not-allowed;
}

.day.today {
    border: 2px solid #0077b5;
    background: white;
}

.day.has-posts {
    background: #f0f7ff;
}

.day-num {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    line-height: 1;
}

/* Dots */
.dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    justify-content: center;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot.blue {
    background: #0077b5; /* Scheduled personal */
}

.dot.purple {
    background: #9333ea; /* Scheduled org */
}

.dot.green {
    background: #28a745; /* Published */
}

/* ============================================================================
   MODAL OVERLAY
   ============================================================================ */

.cal-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cal-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

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

.cal-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1a1a1a;
}

.cal-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.cal-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Modal Sections */
.modal-section {
    margin-bottom: 24px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

/* Post Cards */
.modal-post {
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
}

.modal-post:last-child {
    margin-bottom: 0;
}

.modal-post.published {
    background: #f0f9f4;
    border-color: #c3e6cb;
}

.modal-post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-post-header .time {
    font-size: 13px;
    font-weight: 600;
    color: #0077b5;
}

.modal-post-header .type {
    font-size: 12px;
    color: #666;
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
}

.modal-post .text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 10px;
}

.modal-post .actions {
    display: flex;
    gap: 8px;
}

.btn-edit,
.btn-cancel {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.btn-edit {
    background: white;
    color: #0077b5;
    border-color: #0077b5;
}

.btn-edit:hover {
    background: #0077b5;
    color: white;
}

.btn-cancel {
    background: white;
    color: #dc3545;
    border-color: #dc3545;
}

.btn-cancel:hover {
    background: #dc3545;
    color: white;
}

.btn-linkedin {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: #0077b5;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-linkedin:hover {
    background: #006399;
}

/* ============================================================================
   MOBILE RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .calendar-widget {
        max-width: 100%;
        padding: 12px;
    }
    
    .calendar-month-year {
        font-size: 14px;
    }
    
    .calendar-legend {
        font-size: 10px;
        gap: 3px;
    }
    
    .legend-item .dot {
        width: 6px;
        height: 6px;
    }
    
    .weekday {
        font-size: 10px;
        padding: 3px 0;
    }
    
    .day {
        padding: 1px;
    }
    
    .day-num {
        font-size: 11px;
    }
    
    .dot {
        width: 4px;
        height: 4px;
    }
    
    .cal-modal {
        margin: 0 12px;
    }
    
    .cal-modal-header {
        padding: 16px;
    }
    
    .cal-modal-header h3 {
        font-size: 16px;
    }
    
    .cal-modal-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .calendar-legend {
        font-size: 9px;
    }
    
    .weekday {
        font-size: 9px;
        padding: 2px 0;
    }
    
    .day-num {
        font-size: 10px;
    }
    
    .modal-post .actions {
        flex-direction: column;
    }
    
    .btn-edit,
    .btn-cancel {
        width: 100%;
    }
}

/* ============================================================================
   SIDEBAR SPECIFIC STYLES
   Ensures calendar fits nicely in sidebar
   ============================================================================ */

.sidebar .calendar-widget {
    width: 100%;
    max-width: 100%; /* Fill sidebar width */
}

.sidebar-section .calendar-widget {
    width: 100%;
}