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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideInUp 0.6s ease-out;
}

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

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
    background: linear-gradient(to right, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--border-color);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.progress-step.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.progress-step.completed .step-circle::after {
    content: '✓';
    position: absolute;
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

.progress-step.active .step-label {
    color: var(--primary-color);
}

.progress-step.completed .step-label {
    color: var(--success-color);
}

.progress-line {
    flex: 1;
    height: 3px;
    background: var(--border-color);
    margin: 0 10px;
    position: relative;
    overflow: hidden;
}

.progress-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.5s ease;
}

.progress-step.completed ~ .progress-line::after,
.progress-step.active ~ .progress-line::after {
    width: 100%;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-content i {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    animation: fadeInDown 0.8s ease-out;
}

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

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.main-content {
    padding: 40px;
}

/* Sections */
.section {
    display: none;
    animation: fadeInSlide 0.5s ease-in;
}

.section.active {
    display: block;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    animation: slideInRight 0.6s ease-out;
}

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

.section-header h2 {
    color: var(--dark-color);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header i {
    color: var(--primary-color);
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    flex-direction: row;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

/* Input Lists */
.input-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.input-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeInScale 0.5s ease-out backwards;
}

.input-item:nth-child(1) { animation-delay: 0.1s; }
.input-item:nth-child(2) { animation-delay: 0.2s; }
.input-item:nth-child(3) { animation-delay: 0.3s; }
.input-item:nth-child(4) { animation-delay: 0.4s; }
.input-item:nth-child(5) { animation-delay: 0.5s; }
.input-item:nth-child(6) { animation-delay: 0.6s; }

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

.input-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.input-item label {
    font-weight: 600;
    min-width: 80px;
    color: var(--dark-color);
}

.input-item input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-item input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: scale(1.02);
}

.input-item input:hover {
    border-color: var(--primary-color);
}

/* Mapping List */
.mapping-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.mapping-item {
    padding: 20px;
    background: var(--light-color);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    animation: slideInLeft 0.5s ease-out backwards;
}

.mapping-item:nth-child(1) { animation-delay: 0.1s; }
.mapping-item:nth-child(2) { animation-delay: 0.2s; }
.mapping-item:nth-child(3) { animation-delay: 0.3s; }
.mapping-item:nth-child(4) { animation-delay: 0.4s; }
.mapping-item:nth-child(5) { animation-delay: 0.5s; }

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

.mapping-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.mapping-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mapping-item select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.mapping-item select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.mapping-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: scale(1.01);
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
}

.btn i {
    position: relative;
    z-index: 1;
}

.btn span {
    position: relative;
    z-index: 1;
}

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

.btn-primary:hover {
    background: #3a7bc8;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--warning-color);
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Timetable Display */
.timetable-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.timetable {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.timetable th,
.timetable td {
    padding: 15px;
    text-align: center;
    border: 2px solid var(--border-color);
}

.timetable th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.timetable td {
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.timetable td:hover {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 10;
    position: relative;
}

.timetable .period-header {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.subject-cell {
    font-weight: 600;
    color: var(--dark-color);
}

.teacher-name {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 5px;
}

.break-cell {
    background: #fff3cd !important;
    color: var(--warning-color);
    font-weight: 600;
    font-style: italic;
}

/* Teacher Assignments */
.teacher-assignments {
    padding: 25px;
    background: var(--light-color);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    animation: fadeInUp 0.8s ease-out;
}

.teacher-assignments h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.teacher-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.teacher-card {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: popIn 0.5s ease-out backwards;
}

.teacher-card:nth-child(1) { animation-delay: 0.1s; }
.teacher-card:nth-child(2) { animation-delay: 0.2s; }
.teacher-card:nth-child(3) { animation-delay: 0.3s; }
.teacher-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.teacher-card:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-left-width: 6px;
}

.teacher-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.teacher-card ul {
    list-style: none;
    padding-left: 0;
}

.teacher-card li {
    padding: 5px 0;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.teacher-card li:before {
    content: "📚";
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .input-list {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .timetable th,
    .timetable td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .progress-indicator {
        padding: 20px 15px;
        overflow-x: auto;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
    
    .step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .progress-line {
        margin: 0 5px;
        min-width: 20px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .header,
    .footer,
    .action-buttons,
    .btn {
        display: none !important;
    }

    .container {
        box-shadow: none;
    }

    .timetable {
        page-break-inside: avoid;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transition: right 0.3s ease;
    min-width: 300px;
}

.notification.show {
    right: 20px;
}

.notification i {
    font-size: 1.5rem;
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-success i {
    color: var(--success-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

.notification-error i {
    color: var(--danger-color);
}

.notification-info {
    border-left: 4px solid var(--info-color);
}

.notification-info i {
    color: var(--info-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
}

.loading-spinner {
    background: white;
    padding: 40px 60px;
    border-radius: 15px;
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

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

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.loading-spinner p {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin: 0;
}

/* Progress Bar Animation */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
