* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d);
    padding: 20px;
    color: white;
    text-align: center;
}

header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.btn-nav {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    margin: 0 10px;
}

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

.filter-select {
    padding: 10px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.filter-select option {
    background: #333;
    color: white;
}

.region-filter {
    background: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    font-weight: 700;
}

.region-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 4px;
}

.region-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.region-btn.active {
    background: white;
    color: #ff6b6b;
}

.sync-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-buttons {
    display: flex;
    align-items: center;
}

#currentMonth {
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 150px;
}

main {
    padding: 30px;
}

.calendar-container {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.weekday {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: #e9ecef;
    width: 100%;
}

.calendar-day {
    background: white;
    min-height: 120px;
    max-width: 100%;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    background: #f1f3f4;
    transform: scale(1.02);
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #adb5bd;
}

.calendar-day.today {
    background: #f0f4ff;
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.4);
    z-index: 1;
}

.day-number {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.day-classes {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.class-item {
    background: linear-gradient(135deg, #9c27b0, #e91e63);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.2;
    max-width: 100%;
    display: block;
}

.class-item:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.class-item.bharatnatyamfusion { background: linear-gradient(135deg, #1a237e, #5c6bc0); }
.class-item.bhangra { background: linear-gradient(135deg, #2e7d32, #4caf50); }
.class-item.bhangrafusion { background: linear-gradient(135deg, #66bb6a, #a5d6a7); }
.class-item.bollyfemme { background: linear-gradient(135deg, #1a1a1a, #d50000); }
.class-item.bollywood { background: linear-gradient(135deg, #e65100, #ff9800); }
.class-item.bollywoodfusion { background: linear-gradient(135deg, #e65100, #ff9800); }
.class-item.bollywoodstreetjazz { background: linear-gradient(135deg, #e65100, #ff9800); }
.class-item.contemporary { background: linear-gradient(135deg, #00838f, #4dd0e1); }
.class-item.heels { background: linear-gradient(135deg, #b71c1c, #ef5350); }
.class-item.hiphop { background: linear-gradient(135deg, #1565c0, #64b5f6); }
.class-item.semiclassical { background: linear-gradient(135deg, #6a1b9a, #e91e63); }
.class-item.imge { background: linear-gradient(135deg, #d84315, #8d6e63); }
.class-item.other { background: linear-gradient(135deg, #455a64, #90a4ae); }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    flex-wrap: wrap;
}

#classDetails {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.detail-label {
    font-weight: 600;
    color: #495057;
}

.detail-value {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        border-radius: 0;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .nav-buttons {
        order: -1;
        justify-content: center;
    }
    
    .btn-nav {
        padding: 12px 20px;
        margin: 0 5px;
        font-size: 16px;
        min-width: 44px; /* Better touch target */
    }
    
    #currentMonth {
        font-size: 1.1rem;
        text-align: center;
    }
    
    #addClassBtn {
        padding: 15px 25px;
        font-size: 16px;
        width: 100%;
    }
    
    .filter-select {
        padding: 15px;
        font-size: 16px;
        width: 100%;
    }
    
    main {
        padding: 15px;
    }
    
    .weekday {
        padding: 10px 5px;
        font-size: 12px;
    }
    
    .calendar-day {
        min-height: 90px;
        max-width: 100%;
        padding: 8px 4px;
        overflow: hidden;
    }
    
    .day-number {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .class-item {
        font-size: 11px;
        padding: 4px 6px;
        margin-bottom: 3px;
        line-height: 1.3;
        border-radius: 10px;
        word-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        max-width: 100%;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 5% auto;
        padding: 20px 15px;
        border-radius: 10px;
        max-height: 90vh;
    }
    
    .modal h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .form-group input,
    .form-group select {
        padding: 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 25px;
    }
    
    .btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        margin-bottom: 0;
        border-radius: 8px;
    }
    
    #classDetails {
        padding: 15px;
        border-radius: 8px;
    }
    
    .detail-item {
        padding: 12px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-label {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .detail-value {
        font-size: 16px;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }
    
    .calendar-day {
        min-height: 75px;
        max-width: 100%;
        padding: 6px 3px;
        overflow: hidden;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .class-item {
        font-size: 10px;
        padding: 3px 5px;
        border-radius: 8px;
        word-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        line-height: 1.2;
        max-width: 100%;
    }
    
    .weekday {
        padding: 8px 3px;
        font-size: 11px;
    }
    
    .modal-content {
        padding: 15px 10px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
    }
}

@media (max-width: 360px) {
    header h1 {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .calendar-day {
        min-height: 65px;
        max-width: 100%;
        padding: 4px 2px;
        overflow: hidden;
    }
    
    .day-number {
        font-size: 13px;
    }
    
    .class-item {
        font-size: 9px;
        padding: 2px 4px;
        margin-bottom: 2px;
        word-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        line-height: 1.1;
        max-width: 100%;
    }
    
    .weekday {
        padding: 6px 2px;
        font-size: 10px;
    }
    
    main {
        padding: 10px;
    }
}

/* Color Legend */
.color-legend-link {
    text-align: right;
    margin: 0;
    font-size: 14px;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.teacher-filter {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.teacher-filter option {
    background: white;
    color: #333;
}

.color-legend-link a {
    color: #667eea;
    text-decoration: none;
}

.color-legend-link a:hover {
    text-decoration: underline;
}

.legend-modal {
    max-width: 500px;
}

.legend-modal h2 {
    text-align: center;
    margin-bottom: 20px;
}

.legend-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.legend-pill {
    padding: 4px 8px;
    border-radius: 15px;
    color: white !important;
    font-size: 11px;
    font-weight: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .legend-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer Styles */
.site-footer {
    background: #f8f9fa;
    padding: 8px 15px 10px;
    margin-top: 20px;
    border-top: 1px solid rgba(233, 236, 239, 0.6);
    text-align: center;
    font-size: 0.75em;
}

.footer-content {
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.3;
}

.footer-content p {
    margin-bottom: 4px;
    color: #6c757d;
}

.footer-content p:nth-child(2) {
    line-height: 1.2;
}

.footer-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}


.footer-content .disclaimer {
    font-size: 0.9em;
    color: #adb5bd;
    font-style: italic;
}

.footer-content .signature {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(233, 236, 239, 0.5);
    color: #6c757d;
}

.footer-content .signature em {
    color: #adb5bd;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 6px 10px 8px;
        margin-top: 15px;
        font-size: 0.7em;
    }
    
    .footer-content p {
        margin-bottom: 3px;
    }
    
}
