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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffe9e9;
    min-height: 100vh;
    padding: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 25px;
}

/* Header Section */
.header {
    text-align: center;
    margin-bottom: 35px;
}

.title {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.subtitle {
    font-size: 1.1em;
    color: #666;
    word-wrap: break-word;
}

/* About Section */
.about {
    margin-bottom: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.about h2 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.4em;
}

.about-content {
    color: #555;
    line-height: 1.6;
    font-size: 1em;
}

/* Schedule Section */
.schedule {
    margin-top: 40px;
}

.schedule h2 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.timezone-selection {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f4ff;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.timezone-selection label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.timezone-select-schedule {
    width: 100%;
    padding: 10px;
    font-size: 0.95em;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    cursor: pointer;
    background-color: white;
    transition: all 0.3s ease;
}

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

.timezone-info {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95em;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 25px;
}

.day-column {
    /* keep top padding, remove side padding, set bottom to 15px */
    padding: 15px 0 15px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-width: 0; /* prevent flex children from causing horizontal overflow */
}

.day-name {
    color: white;
    text-align: center;
    margin-bottom: 12px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px; /* reduced ~60% from 5px */
    /* allow inner grid to grow and keep equal heights across columns */
    flex: 1 1 auto;
    /* allow vertical scrolling but prevent horizontal scrollbars */
    overflow-y: auto;
    overflow-x: hidden;
    /* Reserve scrollbar gutter so hover scale doesn't introduce layout shifts or new scrollbars */
    scrollbar-gutter: stable both-edges;
}

.time-slot {
    /* reduced by ~60% from previous values to tighten spacing */
    padding: 4px 4px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
    /* Promote to its own layer to avoid repaint/overflow artifacts when scaling */
    will-change: transform;
    backface-visibility: hidden;
    transform-origin: center;
}

.time-slot:hover {
    /* slightly smaller scale to avoid overflow caused by large transforms */
    transform: translateZ(0) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    background: #667eea;
    color: white;
}

.time-slot:active {
    transform: scale(0.95);
}

.time-slot.disabled-slot {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

/* Tablet Design */
@media (min-width: 480px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 30px;
    }

    .title {
        font-size: 2.2em;
    }

    .subtitle {
        font-size: 1.2em;
    }

    .about h2 {
        font-size: 1.6em;
    }

    .schedule h2 {
        font-size: 1.6em;
    }

    .schedule-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }

    .time-slot {
        font-size: 0.95em;
        /* reduced by ~60% from previous values */
        padding: 2px 3px;
    }
}

/* Medium tablets */
@media (min-width: 640px) {
    .schedule-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .time-slots {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large tablets and small desktops */
@media (min-width: 768px) {
    .container {
        padding: 40px;
    }

    .title {
        font-size: 2.5em;
    }

    .subtitle {
        font-size: 1.3em;
    }

    .about {
        padding: 30px;
        margin-bottom: 50px;
    }

    .about h2 {
        font-size: 1.8em;
    }

    .about-content {
        font-size: 1.1em;
    }

    .schedule h2 {
        font-size: 1.8em;
    }

    .timezone-info {
        font-size: 1.1em;
        margin-bottom: 30px;
    }

    .schedule-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .day-column {
        /* keep existing top padding (20px), remove side padding, set bottom to 15px */
        padding: 20px 0 15px 0;
    }

    .day-name {
        font-size: 1.3em;
        margin-bottom: 15px;
        letter-spacing: 1px;
    }

    .time-slots {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .time-slot {
        font-size: 1em;
        /* reduced by ~60% from previous values */
        padding: 3px 3px;
    }

    .time-slot:hover {
        transform: scale(1.08);
    }
}

/* Large desktops */
@media (min-width: 1024px) {
    .schedule-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Make all day columns visually equal height */
    .day-column {
        /* fixed min-height so .time-slots areas are the same regardless of content */
        min-height: 420px;
    }
}

/* Landscape mode optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 15px;
    }

    .header {
        margin-bottom: 20px;
    }

    .title {
        font-size: 1.5em;
    }

    .about {
        padding: 15px;
        margin-bottom: 20px;
    }
}

/* High DPI devices */
@media (-webkit-min-device-pixel-ratio: 2) {
    .time-slot {
        border: 1px solid rgba(102, 126, 234, 0.1);
    }
}

/* Student Info Section */
.student-info-section {
    margin-top: 40px;
    padding: 25px;
    background: #f0f4ff;
    border-radius: 10px;
    border: 2px solid #667eea;
}

.student-info-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

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

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

.timezone-select,
.student-textarea {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.contact-input {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    transition: all 0.3s ease;
}

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

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

.timezone-select {
    cursor: pointer;
    background-color: white;
}

.student-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Selected Slots Display */
.selected-slots-display {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.selected-slots-display h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.selected-slots-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-slot-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #667eea;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.selected-slot-tag:hover {
    background: #764ba2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.remove-slot-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
}

.remove-slot-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: rotate(90deg);
}

.remove-slot-btn:active {
    transform: rotate(90deg) scale(0.9);
}

.no-selection {
    color: #999;
    font-size: 0.95em;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    touch-action: manipulation;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Success Message */
.success-message {
    margin-top: 20px;
    padding: 16px;
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
    border-radius: 8px;
    text-align: center;
    font-size: 1.05em;
    font-weight: 500;
    animation: slideDown 0.4s ease-out;
}

.success-message.hidden {
    display: none;
}

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

/* Modal Overlay */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.success-modal.hidden {
    display: none;
}

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

.success-modal-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.4s ease-out;
    position: relative;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 1.8em;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

.modal-close-btn:active {
    transform: rotate(90deg) scale(0.9);
}

.success-icon-large {
    font-size: 4em;
    color: #4caf50;
    margin-bottom: 20px;
    animation: popIn 0.6s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-modal-content h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.success-modal-content p {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}

/* Responsive Modal */
@media (max-width: 480px) {
    .success-modal-content {
        margin: 20px;
        padding: 30px;
    }

    .success-icon-large {
        font-size: 3em;
        margin-bottom: 15px;
    }

    .success-modal-content h2 {
        font-size: 1.5em;
    }

    .success-modal-content p {
        font-size: 1em;
    }
}

/* Selected state for time slots */
.time-slot.selected {
    background: #667eea;
    color: white;
    border: 2px solid #764ba2;
}

/* Responsive Student Info */
@media (min-width: 480px) {
    .student-info-section {
        padding: 30px;
    }

    .student-info-section h2 {
        font-size: 1.6em;
    }

    .student-textarea {
        min-height: 140px;
    }
}

@media (min-width: 768px) {
    .student-info-section {
        margin-top: 50px;
        padding: 40px;
    }

    .student-info-section h2 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

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

    .form-group label {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .timezone-select,
    .student-textarea {
        font-size: 1.05em;
        padding: 14px;
    }

    .student-textarea {
        min-height: 150px;
    }

    .submit-btn {
        padding: 16px;
        font-size: 1.15em;
    }
}
