/* PYT Course Calendar - Frontend Styles */

/* Main Calendar Container */
.pyt-course-calendar-wrapper {
    max-width: 1200px;
    min-width: 300px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100%;
    box-sizing: border-box;
}

/* Calendar Header */
.pyt-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pyt-calendar-title-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

.pyt-calendar-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    gap: 12px;
    align-items: center;
}

.pyt-month-select,
.pyt-year-select {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.pyt-month-select {
    min-width: 140px;
}

.pyt-year-select {
    min-width: 90px;
}

.pyt-month-select:hover,
.pyt-year-select:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.pyt-month-select:focus,
.pyt-year-select:focus {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
}

.pyt-month-select option,
.pyt-year-select option {
    background: #2c3e50;
    color: white;
}

.pyt-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pyt-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.pyt-nav-btn:active {
    transform: scale(0.95);
}

/* Legend */
.pyt-calendar-legend {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pyt-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.pyt-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pyt-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.pyt-legend-label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

/* Calendar Grid */
.pyt-calendar-grid {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
}

.pyt-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    width: 100%;
}

.pyt-weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pyt-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    min-height: 600px;
    width: 100%;
}

/* Calendar Day Cell */
.pyt-day {
    border: 1px solid #e9ecef;
    padding: 8px;
    min-height: 100px;
    position: relative;
    background: white;
    transition: background-color 0.2s ease;
    overflow: hidden;
}

.pyt-day:hover {
    background: #f8f9fa;
}

.pyt-day.other-month {
    background: #fafbfc;
}

.pyt-day.other-month .pyt-day-number {
    color: #adb5bd;
}

.pyt-day-number {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    margin-bottom: 4px;
    display: block;
    position: relative;
    z-index: 2;
}

.pyt-day-events {
    position: relative;
    z-index: 1;
    max-width: 100%;
}

.pyt-day.today {
    background: #fff3cd;
    border-color: #ffc107;
}

.pyt-day.today .pyt-day-number {
    color: #ff6b6b;
    font-weight: 700;
}

/* Course Event */
.pyt-course-event {
    background: #3498db;
    color: white;
    padding: 4px 6px;
    margin-bottom: 3px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    max-width: 100%;
    display: block;
}

.pyt-course-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
    white-space: normal;
}

.pyt-course-event.multi-day {
    border-left: 3px solid rgba(255, 255, 255, 0.5);
}

.pyt-course-event-title {
    font-weight: 600;
    display: block;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pyt-course-duration {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
    display: block;
}

/* Tooltip */
.pyt-tooltip {
    position: fixed;
    background: #2c3e50;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    word-wrap: break-word;
    line-height: 1.4;
}

.pyt-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #2c3e50;
}

.pyt-tooltip.show {
    display: block;
    opacity: 1;
}

.pyt-tooltip-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pyt-tooltip-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    margin-bottom: 6px;
}

.pyt-tooltip-dates {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.pyt-tooltip-description {
    line-height: 1.5;
}

/* Loading State */
.pyt-loading {
    text-align: center;
    padding: 40px;
}

.pyt-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: pyt-spin 1s linear infinite;
}

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

/* Tablet Responsive (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .pyt-calendar-title {
        font-size: 20px;
    }
    
    .pyt-month-select,
    .pyt-year-select {
        font-size: 16px;
    }
    
    .pyt-calendar-days {
        grid-template-rows: repeat(6, 1fr);
        min-height: 480px;
    }
    
    .pyt-day {
        min-height: 80px;
        padding: 6px;
    }
    
    .pyt-course-event {
        font-size: 11px;
        padding: 3px 5px;
    }
}

/* Mobile Responsive (up to 767px) */
@media screen and (max-width: 767px) {
    .pyt-course-calendar-wrapper {
        padding: 10px;
    }
    
    .pyt-calendar-header {
        padding: 12px 15px;
        border-radius: 8px;
    }
    
    .pyt-calendar-title {
        font-size: 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .pyt-month-select,
    .pyt-year-select {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .pyt-month-select {
        min-width: 120px;
    }
    
    .pyt-year-select {
        min-width: 75px;
    }
    
    .pyt-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .pyt-calendar-legend {
        padding: 10px;
    }
    
    .pyt-legend-items {
        gap: 8px;
    }
    
    .pyt-legend-item {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .pyt-weekday {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .pyt-calendar-days {
        grid-template-rows: repeat(6, 1fr);
        min-height: 360px;
    }
    
    .pyt-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .pyt-day-number {
        font-size: 12px;
    }
    
    .pyt-course-event {
        font-size: 10px;
        padding: 2px 4px;
        margin-bottom: 2px;
    }
    
    .pyt-course-duration {
        display: none; /* Hide duration on mobile to save space */
    }
    
    .pyt-tooltip {
        max-width: 250px;
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* Very Small Mobile (up to 400px) */
@media screen and (max-width: 400px) {
    .pyt-calendar-title {
        font-size: 14px;
    }
    
    .pyt-month-select,
    .pyt-year-select {
        font-size: 12px;
        padding: 5px 8px;
    }
    
    .pyt-month-select {
        min-width: 100px;
    }
    
    .pyt-year-select {
        min-width: 65px;
    }
    
    .pyt-weekday {
        font-size: 10px;
        padding: 6px 2px;
    }
    
    .pyt-calendar-days {
        grid-template-rows: repeat(6, 1fr);
        min-height: 300px;
    }
    
    .pyt-day {
        min-height: 50px;
        padding: 3px;
    }
    
    .pyt-day-number {
        font-size: 11px;
    }
    
    .pyt-course-event {
        font-size: 9px;
        padding: 2px 3px;
    }
    
    .pyt-course-event-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* List View */
.pyt-list-view {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.pyt-list-view-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.pyt-list-view-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pyt-list-loading {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

.pyt-list-empty {
    text-align: center;
    color: #6c757d;
    padding: 30px;
    font-size: 16px;
}

.pyt-list-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pyt-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.pyt-list-item-color {
    width: 6px;
    min-width: 6px;
    height: 100%;
    min-height: 60px;
    border-radius: 3px;
    flex-shrink: 0;
}

.pyt-list-item-content {
    flex: 1;
}

.pyt-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}

.pyt-list-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
}

.pyt-list-item-category {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.pyt-list-item-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-size: 15px;
    margin-bottom: 8px;
    font-weight: 500;
}

.pyt-list-item-dates svg {
    width: 18px;
    height: 18px;
    color: #667eea;
    flex-shrink: 0;
}

.pyt-list-item-duration {
    display: inline-block;
    background: #e7f3ff;
    color: #0066cc;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
}

.pyt-list-item-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Responsive List View */
@media (max-width: 768px) {
    .pyt-list-view {
        padding: 20px 15px;
        margin-top: 30px;
    }
    
    .pyt-list-view-title {
        font-size: 20px;
    }
    
    .pyt-list-item {
        padding: 15px;
        flex-direction: column;
        gap: 12px;
    }
    
    .pyt-list-item-color {
        width: 100%;
        height: 4px;
        min-height: 4px;
    }
    
    .pyt-list-item-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .pyt-list-item-title {
        font-size: 16px;
    }
    
    .pyt-list-item-dates {
        font-size: 14px;
    }
    
    .pyt-list-item-duration {
        margin-left: 0;
        margin-top: 4px;
        display: block;
        width: fit-content;
    }
}

/* Print Styles */
@media print {
    .pyt-calendar-header,
    .pyt-calendar-legend {
        break-inside: avoid;
    }
    
    .pyt-nav-btn {
        display: none;
    }
    
    .pyt-course-event {
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.2);
    }
}
