* {
    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%);
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.container {
    background: white;
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

/* Admin Link */
.admin-link {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.admin-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.admin-link svg {
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
}

/* Main Content */
.main-content {
    display: flex;
    gap: 0;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.main-content::-webkit-scrollbar {
    display: none;
}

/* Content Row - Left Panel */
.content-row {
    width: 50%;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    padding: 40px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content-row::-webkit-scrollbar {
    display: none;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-card {
    background: white;
    border: none;
    border-radius: 15px;
    padding: 30px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    outline: none;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.action-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-card:hover::before {
    opacity: 1;
}

.action-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.action-card.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.action-card.primary .action-icon {
    background: rgba(255, 255, 255, 0.2);
}

.action-card.primary h3,
.action-card.primary p {
    color: white;
}

.action-card.primary::before {
    background: white;
}

.action-icon {
    font-size: 3em;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 15px;
    flex-shrink: 0;
}

.action-card-content {
    flex: 1;
}

.action-card h3 {
    color: #2d3748;
    font-size: 1.3em;
    margin-bottom: 5px;
    font-weight: 700;
}

.action-card p {
    color: #718096;
    font-size: 0.95em;
    margin: 0;
}

/* Collapsible Section - Schedule (Right Panel) */
.collapsible-section {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background: white;
    padding: 40px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: none;
    z-index: 10;
}

.collapsible-section::-webkit-scrollbar {
    display: none;
}

.collapsible-section.open {
    display: block;
}

/* Schedule Panel (Left Panel - below quick actions) */
.schedule-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 20px;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.schedule-panel.open {
    display: block;
}

.schedule-container {
    background: transparent;
    padding: 0;
}

/* Schedule Header */
.schedule-header {
    margin-bottom: 20px;
}

.schedule-header h2 {
    color: #2d3748;
    font-size: 1.5em;
    margin-bottom: 5px;
    font-weight: 700;
}

.schedule-header p {
    color: #718096;
    font-size: 0.9em;
}

/* Room Selector */
.room-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    align-items: center;
    flex-shrink: 0;
}

.room-selector label {
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
    font-size: 1em;
}

.room-selector select {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

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

/* Schedule Table */
.schedule-table {
    overflow-x: auto;
    flex: 1;
}

.schedule-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9em;
}

.schedule-table th,
.schedule-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.schedule-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}

.schedule-table tbody tr:hover {
    background: #f7fafc;
}

.no-schedule {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-size: 1em;
}

/* Login Container - Right Panel */
.login-container {
    width: 50%;
    background: white;
    padding: 40px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: block;
}

.login-container::-webkit-scrollbar {
    display: none;
}

/* Login Header */
.login-header {
    margin-bottom: 30px;
}

.login-header h2 {
    color: #2d3748;
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header p {
    color: #718096;
    font-size: 1em;
}

/* Login Tabs */
.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #718096;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-btn:hover:not(.active) {
    color: #667eea;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 10px;
}

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

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

/* Upload Section */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-area {
    position: relative;
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.upload-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.02);
}

.upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    color: #667eea;
    margin-bottom: 10px;
}

.upload-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2d3748;
}

.upload-subtitle {
    font-size: 1em;
    color: #718096;
}

.upload-hint {
    color: #a0aec0;
    font-size: 0.85em;
    margin-top: 5px;
}

.upload-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.upload-info p {
    color: #856404;
    font-size: 0.9em;
    margin: 5px 0;
}

.upload-preview {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Loading Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay p {
    color: white;
    font-size: 1.2em;
    margin-top: 20px;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

.spinner-small {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    background: white;
    padding: 35px;
    border-radius: 15px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.popup-content h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.6em;
}

.popup-content p {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Warning Popup */
.warning-popup {
    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: 3000;
}

.warning-content {
    background: white;
    padding: 35px;
    border-radius: 15px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-top: 5px solid #ed8936;
    animation: slideUp 0.3s ease;
}

.warning-content h3 {
    color: #dd6b20;
    margin-bottom: 15px;
    font-size: 1.6em;
}

.status-text {
    color: #718096;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #4a5568;
}

.btn-warning {
    background: #ed8936;
    color: white;
}

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

/* Admin Login Popup */
.admin-login-content {
    max-width: 400px;
    text-align: left;
}

.admin-login-content h3 {
    text-align: center;
    margin-bottom: 10px;
}

.admin-login-content > p {
    text-align: center;
    margin-bottom: 25px;
    color: #718096;
}

.admin-login-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.admin-login-buttons .btn {
    flex: 1;
}

.error-message {
    color: #e53e3e;
    background: #fff5f5;
    border: 1px solid #fc8181;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9em;
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Schedule Grid for Room Viewer */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.day-schedule {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e2e8f0;
}

.day-schedule h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.1em;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.class-item {
    background: #f7fafc;
    border-left: 4px solid #cbd5e0;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.class-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.class-item.class-active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.class-time {
    font-weight: 700;
    color: #667eea;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.class-subject {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 3px;
}

.class-instructor {
    font-size: 0.85em;
    color: #718096;
    margin-bottom: 3px;
}

.class-edp {
    font-size: 0.8em;
    color: #a0aec0;
}

.no-classes {
    text-align: center;
    color: #a0aec0;
    font-size: 0.9em;
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .main-content {
        flex-direction: column;
    }

    .content-row {
        width: 100%;
        flex-direction: column;
        height: auto;
    }

    .quick-actions {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .action-card {
        height: auto;
        padding: 20px;
    }

    .collapsible-section {
        position: relative;
        width: 100%;
        height: auto;
        right: auto;
        top: auto;
    }

    .schedule-panel {
        margin-top: 15px;
    }

    .login-container {
        width: 100%;
    }

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

    .admin-link {
        top: 12px;
        right: 12px;
        font-size: 0.8em;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        height: calc(100vh - 20px);
    }

    .header h1 {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .action-card {
        padding: 18px 15px;
    }

    .action-icon {
        font-size: 2.2em;
    }
}
