* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Remove the blue highlight box on tap */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    /* Improve overall touch performance */
    touch-action: manipulation;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 20px;
}

/* Ensure smooth scrolling on mobile */
html {
    -webkit-overflow-scrolling: touch;
}

/* Allow text selection for content areas only */
.subject-name,
.day-header h2,
.time-slot,
.header p,
.day-date,
.batch-info span,
.no-classes p {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Prevent text selection on interactive elements */
.toggle-btn,
.day-btn,
button,
.schedule-item,
.day-header,
.subject-type,
.today-indicator {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.toggle-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    /* Mobile touch improvements */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.toggle-btn:active {
    transform: scale(0.95) translateY(-2px);
    opacity: 0.9;
}

.toggle-btn.active {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.day-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.day-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    /* Mobile touch improvements */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    -webkit-user-select: none;
    user-select: none;
}

.day-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.day-btn:active {
    transform: scale(0.95) translateY(-1px);
    opacity: 0.9;
}

.day-btn.active {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.timetable-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.day-section {
    margin-bottom: 2rem;
}

.day-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.day-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.day-header .day-date {
    color: #94a3b8;
    font-size: 0.9rem;
}

.today-indicator {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.schedule-grid {
    display: grid;
    gap: 1rem;
}

.schedule-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    /* Remove any potential tap highlights */
    -webkit-tap-highlight-color: transparent;
}

.schedule-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.schedule-item:active {
    transform: scale(0.98) translateY(-1px);
    opacity: 0.9;
}

.schedule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

.schedule-item.theory::before {
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
}

.schedule-item.lab::before {
    background: linear-gradient(45deg, #43e97b 0%, #38f9d7 100%);
}

.schedule-item.activity::before {
    background: linear-gradient(45deg, #fa709a 0%, #fee140 100%);
}

.schedule-item.optional::before {
    background: linear-gradient(45deg, #a8edea 0%, #fed6e3 100%);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.time-slot {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4facfe;
}

.subject-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.subject-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.current-time-indicator {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #ffa500);
    border-radius: 2px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px #ff6b6b; }
    to { box-shadow: 0 0 20px #ffa500; }
}

.no-classes {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 1.1rem;
}

.no-classes i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Icons in clickable elements */
.toggle-btn i,
.day-btn i,
.schedule-item i {
    pointer-events: none;
}

/* Improve icon interactions */
.fas, .far, .fal, .fab {
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

/* Better focus states for accessibility */
.toggle-btn:focus,
.day-btn:focus {
    outline: 2px solid rgba(74, 144, 226, 0.6);
    outline-offset: 2px;
}

/* Remove focus outline on touch devices */
@media (hover: none) and (pointer: coarse) {
    .toggle-btn:focus,
    .day-btn:focus {
        outline: none;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }

    .day-filters {
        gap: 0.3rem;
    }

    .day-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .timetable-container {
        padding: 1rem;
    }

    .schedule-item {
        padding: 1rem;
    }

    .schedule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .subject-name {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .day-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0.5rem 0;
    }

    .day-btn {
        white-space: nowrap;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}