/* SureCart Course Extension - Calendar Styles */
/* Version: 1.2.0 - Week-Wrapped Timelines */

/* ============================================
   ROOT & VARIABLES
   ============================================ */
.sce-calendar-wrap {
    --sce-primary: #2196F3;
    --sce-track-height: 10px;
    --sce-primary-light: #64B5F6;
    --sce-primary-dark: #1976D2;
    --sce-text: #333;
    --sce-text-light: #666;
    --sce-text-lighter: #999;
    --sce-border: #e0e0e0;
    --sce-bg: #fff;
    --sce-bg-light: #f5f5f5;
    --sce-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --sce-shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --sce-radius: 8px;
    --sce-transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sce-text);
    line-height: 1.6;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   CALENDAR GRID - Bottom Padding
   ============================================ */
.sce-calendar-grid {
    margin-bottom: 48px;
    padding-bottom: 24px;
}

/* ============================================
   CALENDAR HEADER - Enhanced Padding & Styling
   ============================================ */
.sce-calendar-header {
    background: var(--sce-bg);
    border: 1px solid var(--sce-border);
    border-radius: var(--sce-radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--sce-shadow);
}

.sce-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sce-border);
}

.sce-calendar-nav h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    color: var(--sce-text);
}

.sce-nav-buttons {
    display: flex;
    gap: 10px;
}

.sce-nav-btn {
    background: var(--sce-bg);
    border: 2px solid var(--sce-border);
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sce-text);
    cursor: pointer;
    transition: var(--sce-transition);
}

.sce-nav-btn:hover {
    border-color: var(--sce-primary);
    color: var(--sce-primary);
    background: var(--sce-bg-light);
}

/* ============================================
   FILTERS - Enhanced Spacing & Layout
   ============================================ */
.sce-calendar-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.sce-filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sce-filter-group {
    display: flex;
    gap: 10px;
}

.sce-type-filter {
    display: flex;
    gap: 8px;
    background: var(--sce-bg-light);
    padding: 6px;
    border-radius: 8px;
}

.sce-type-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sce-text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--sce-transition);
}

.sce-type-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--sce-text);
}

.sce-type-btn.active {
    background: var(--sce-primary);
    color: white;
}

.sce-search-input,
.sce-venue-filter,
.sce-category-filter {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--sce-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--sce-text);
    transition: var(--sce-transition);
}

.sce-search-input:focus,
.sce-venue-filter:focus,
.sce-category-filter:focus {
    outline: none;
    border-color: var(--sce-primary);
}

.sce-search-input::placeholder {
    color: var(--sce-text-lighter);
}

/* ============================================
   CALENDAR GRID
   ============================================ */
.sce-calendar-grid {
    background: var(--sce-bg);
    border: 1px solid var(--sce-border);
    border-radius: var(--sce-radius);
    overflow: hidden;
    box-shadow: var(--sce-shadow);
    margin-bottom: 40px; /* Add space below calendar */
}

.sce-calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--sce-bg-light);
    border-bottom: 2px solid var(--sce-border);
}

.sce-calendar-header-cell {
    padding: 14px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--sce-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sce-calendar-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 2px solid var(--sce-border);
    position: relative;
}

.sce-calendar-week-row:last-child {
    border-bottom: none;
}

/* ============================================
   CALENDAR DAYS
   ============================================ */
.sce-calendar-day {
    min-height: 100px;
    padding: 8px;
    border-right: 2px solid var(--sce-border);
    border-bottom: 2px solid var(--sce-border);
    position: relative;
    background: var(--sce-bg);
}

.sce-calendar-day:nth-child(7n) {
    border-right: none;
}

.sce-day-number {
    display: inline-block;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sce-text);
    border-radius: 4px;
    position: relative;
    z-index: 10; /* Keep above timeline elements */
    background: var(--sce-bg); /* Ensure visibility */
}

.sce-calendar-day.other-month {
    background: var(--sce-bg-light);
}

.sce-calendar-day.other-month .sce-day-number {
    color: var(--sce-text-lighter);
}

.sce-calendar-day.today {
    border: 2px solid var(--sce-primary);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.sce-calendar-day.today .sce-day-number {
    color: var(--sce-primary);
    font-weight: 600;
}

.sce-day-courses {
    margin-top: 8px;
    position: relative;
    min-height: 60px; /* Allow space for multiple stacked timelines */
}

/* ============================================
   TIMELINE SEGMENTS - Week-Wrapped
   ============================================ */
.sce-course-timeline-segment {
    position: absolute;
    top: calc(8px + (var(--sce-track-height, 12px) * var(--track, 0)));
    left: 4px; /* Padding from left border */
    right: 4px; /* Padding from right border */
    height: 1px;
    border-radius: 0;
    cursor: pointer;
    transition: var(--sce-transition);
    opacity: 0.6;
    z-index: 1;
}

.sce-course-timeline-segment:hover {
    opacity: 1;
    height: 2px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Timeline Markers - Removed in favor of session rectangles only */

/* Session Markers - Full-width rectangles */
.sce-session-marker {
    position: absolute;
    top: calc(8px + (var(--sce-track-height, 12px) * var(--track, 0)));
    left: 0;
    width: 100%;
    height: 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--sce-transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 5;
    opacity: 0.9;
    transform: translateY(-50%); /* Center on timeline */
}

.sce-session-marker:hover {
    opacity: 1;
    height: 10px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    z-index: 15;
}

/* ============================================
   TOOLTIPS
   ============================================ */
.sce-tooltip {
    position: absolute;
    background: white;
    border: 1px solid var(--sce-border);
    border-radius: 8px;
    box-shadow: var(--sce-shadow-lg);
    padding: 0;
    max-width: 320px;
    z-index: 1000;
    pointer-events: none;
}

.sce-tooltip-header {
    background: var(--sce-bg-light);
    padding: 12px 16px;
    border-bottom: 1px solid var(--sce-border);
    font-weight: 600;
    font-size: 15px;
    color: var(--sce-text);
    border-radius: 8px 8px 0 0;
}

.sce-tooltip-body {
    padding: 12px 16px;
}

.sce-tooltip-row {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--sce-text);
}

.sce-tooltip-row:last-child {
    margin-bottom: 0;
}

.sce-session-badge {
    display: inline-block;
    background: var(--sce-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

/* ============================================
   DETAIL PANEL
   ============================================ */
.sce-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.sce-detail-panel.active {
    display: block;
}

.sce-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.sce-detail-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: #ffffff; /* Solid white background */
    box-shadow: -4px 0 16px rgba(0,0,0,0.2);
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.sce-detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: var(--sce-text-light);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--sce-transition);
}

.sce-detail-close:hover {
    background: var(--sce-bg-light);
    color: var(--sce-text);
}

.sce-detail-body {
    padding: 28px;
}

.sce-detail-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sce-border);
}

.sce-detail-header h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--sce-text);
}

.sce-detail-meta {
    font-size: 14px;
    color: var(--sce-text-light);
}

.sce-detail-section {
    margin-bottom: 24px;
}

.sce-detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--sce-text);
}

.sce-detail-section p {
    margin: 0;
    font-size: 14px;
    color: var(--sce-text);
    line-height: 1.6;
}

.sce-sessions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sce-sessions-list li {
    padding: 12px;
    background: var(--sce-bg-light);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--sce-text);
}

.sce-sessions-list li:last-child {
    margin-bottom: 0;
}

.sce-detail-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--sce-border);
}

.sce-detail-btn {
    display: inline-block;
    background: var(--sce-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--sce-transition);
}

.sce-detail-btn:hover {
    background: var(--sce-primary-dark);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sce-calendar-header {
        padding: 16px;
    }
    
    .sce-calendar-nav {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .sce-calendar-filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .sce-calendar-day {
        min-height: 80px;
        padding: 6px;
    }
    
    .sce-day-number {
        font-size: 12px;
    }
    
    .sce-detail-content {
        max-width: 100%;
    }
}
/* ============================================
   TOOLTIPS - Updated Styling
   ============================================ */
.sce-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 16px;
    max-width: 300px;
    z-index: 1000;
    pointer-events: none;
}

.sce-tooltip-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.sce-tooltip-session-badge {
    display: inline-block;
    background: #000000;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.sce-tooltip-meta {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.sce-tooltip-meta strong {
    color: #374151;
    font-weight: 600;
}

.sce-tooltip-link {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #3b82f6;
    font-weight: 500;
}

/* ============================================
   DETAIL PANEL - Updated Styling
   ============================================ */
.sce-detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.sce-detail-panel.active {
    display: block;
}

.sce-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.sce-detail-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: #ffffff;
    box-shadow: -4px 0 16px rgba(0,0,0,0.2);
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.sce-detail-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    z-index: 10;
}

.sce-detail-close:hover {
    color: #374151;
}

.sce-detail-body {
    padding: 40px 32px;
}

.sce-detail-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.sce-detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.sce-tag {
    display: inline-block;
    background: #f3f4f6;
    color: #6b7280;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.sce-detail-section {
    margin-bottom: 24px;
}

.sce-detail-section p {
    font-size: 15px;
    line-height: 1.6;
    color: #6b7280;
    margin: 0;
}

.sce-detail-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 16px 0;
}

.sce-detail-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.sce-info-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.sce-info-icon {
    font-size: 20px;
    line-height: 1;
}

.sce-info-label {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sce-info-value {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

.sce-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sce-session-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.sce-session-date {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.sce-session-time {
    font-size: 14px;
    color: #6b7280;
}

.sce-sessions-more {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

.sce-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.sce-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: #000000;
    color: white;
    border: 2px solid #000000;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sce-btn-primary:hover {
    opacity: 0.8;
}

.sce-btn-secondary {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
}

.sce-btn-secondary:hover {
    opacity: 0.8;
}
