@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Professional blue theme */
body {
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    min-height: 100vh;
}

/* Main content area styling */
main {
    background: #f8f9fa;
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

/* Content panel styling */
#content-panel {
    background: white;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e9ecef;
}

/* Prevent flicker during logout */
#header {
    transition: opacity 0.1s ease-out;
    position: sticky;
    top: 0;
    z-index: 10;
}

.user-dropdown {
    transition: opacity 0.1s ease-out;
}

/* Beautiful Marquee Styles */
.marquee-container {
    width: 100%;
    position: relative;
}

.marquee-content {
    display: flex;
    animation: marquee 25s linear infinite;
    will-change: transform;
}

@keyframes marquee {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Beautiful solid background for marquee */
#welcome-marquee {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    position: sticky;
    top: 80px;
    z-index: 9;
}

/* Static text styling - no color changes */
.marquee-content span {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Static icon styling - no color changes */
.marquee-content i {
    color: #ffd700;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* App container adjustments */
#app {
    background: transparent;
}

/* School branding styles */
.school-logo {
    width: 70px;
    height: 70px;
    margin-right: 12px;
}

.school-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.school-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.school-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.footer {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 2px solid #1e88e5;
}

/* Professional dropdown styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565c0, #1976d2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .school-logo {
        width: 100px;
        height: 100px;
        margin-right: 8px;
    }
    
    .school-name {
        font-size: 1rem;
    }
    
    .school-subtitle {
        font-size: 0.625rem;
    }
    
    .dropdown-content {
        min-width: 180px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

.scroll-panel {
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
}

/* Specific height for teacher/student lists */
.admin-list-scroll {
    max-height: 24rem; /* Adjusted for tab view */
}

.scroll-panel::-webkit-scrollbar {
    width: 8px;
}

.scroll-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.scroll-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.scroll-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    main {
        margin: 10px;
        border-radius: 8px;
    }
    
    #content-panel {
        padding: 16px;
        border-radius: 8px;
    }
    
    .scroll-panel {
        max-height: calc(100vh - 8rem);
    }
    .admin-list-scroll {
        max-height: 20rem;
    }
    /* Mobile table scrolling */
    .mobile-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Mobile form adjustments */
    .mobile-form {
        padding: 1rem;
    }
    /* Mobile tab adjustments */
    .mobile-tabs {
        flex-wrap: wrap;
    }
    .mobile-tabs button {
        min-width: 0;
        flex: 1;
        font-size: 0.875rem;
        padding: 0.75rem 0.5rem;
    }
    /* Mobile card adjustments */
    .mobile-card {
        margin: 0.5rem;
        padding: 1rem;
    }
    /* Mobile grid adjustments */
    .mobile-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    /* Extra small screens */
    .mobile-tabs button {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }
    .mobile-text-sm {
        font-size: 0.875rem;
    }
    .mobile-p-2 {
        padding: 0.5rem;
    }
}

/* Scrolling Notifications Animation */
.scrolling-notifications {
    overflow: hidden;
    position: relative;
}

.animate-scroll {
    display: inline-block;
    animation: scroll-left 30s linear infinite;
    cursor: pointer;
}

.animate-scroll:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.notification-item {
    display: inline-block;
    margin-right: 3rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.notification-item.urgent {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

.notification-item.important {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.2);
}

.notification-item.normal {
    border-left-color: rgba(255, 255, 255, 0.3);
}

/* Welcome Banner Scrolling Animation */
.welcome-banner {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    padding: 16px 0;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 16px rgba(21, 101, 192, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-scroll-container {
    overflow: hidden;
    position: relative;
    height: 24px;
}

.welcome-scroll-text {
    display: inline-block;
    animation: welcome-scroll 20s linear infinite;
    white-space: nowrap;
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
}

.welcome-scroll-text:hover {
    animation-play-state: paused;
}

@keyframes welcome-scroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Responsive adjustments for welcome banner */
@media (max-width: 768px) {
    .welcome-banner {
        padding: 8px 0;
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .welcome-scroll-container {
        height: 20px;
    }
    
    .welcome-scroll-text {
        font-size: 14px;
        line-height: 20px;
        animation-duration: 25s;
    }
}

@media (max-width: 640px) {
    .welcome-scroll-text {
        font-size: 13px;
        animation-duration: 30s;
    }
}

/* Date Filter Mobile Responsiveness */
.date-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.date-filter-input {
    min-width: 140px;
}

.date-filter-presets {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.date-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Mobile-specific date filter styles */
@media (max-width: 768px) {
    .date-filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .date-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .date-filter-group label {
        font-size: 0.875rem;
        font-weight: 600;
        color: #374151;
    }
    
    .date-filter-input {
        min-width: unset;
        width: 100%;
    }
    
    .date-filter-presets {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .date-filter-presets button {
        flex: 1;
        min-width: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .date-filter-actions {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .date-filter-actions button {
        flex: 1;
        min-width: 0;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 640px) {
    .date-filter-container {
        gap: 0.75rem;
    }
    
    .date-filter-presets button {
        padding: 0.375rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .date-filter-actions button {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Tab Styling */
.tab-button {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #495057;
    font-size: 14px;
}

.tab-button:hover {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
}

.tab-button.active {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    border-color: #1565c0;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.tab-button.active:hover {
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
}

/* Button Styling */
.btn-primary {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    border: 1px solid #1565c0;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(21, 101, 192, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%);
    box-shadow: 0 4px 8px rgba(21, 101, 192, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    border-radius: 4px;
    padding: 8px 16px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

/* Homework section mobile adjustments */
@media (max-width: 768px) {
    .homework-header-mobile {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .homework-title-mobile {
        text-align: center;
        margin-bottom: 0;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 0.875rem;
    }
}

/* Professional form styling */
.form-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-section h3 {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    padding: 12px 16px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
    font-size: 16px;
    font-weight: 600;
}

/* Table styling */
.data-table {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table th {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    border-bottom: 2px solid #1565c0;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.data-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tr:hover {
    background-color: #e3f2fd;
}

/* Input styling */
.form-input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Select styling */
.form-select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.form-select:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 32px;
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
}

.toggle-switch input:checked + label:before {
    transform: translateX(24px);
}

/* Professional Role Toggle Styling */
.role-toggle-container {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    position: relative;
    width: 200px;
    height: 48px;
}

.role-toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    position: relative;
    z-index: 2;
}

.role-toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    border-radius: 6px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

.role-toggle-option {
    color: #6b7280;
    transition: color 0.3s ease;
}

/* Default state - Teacher mode (unchecked) */
.role-toggle-container .role-toggle-option.teacher {
    color: white;
}

.role-toggle-container .role-toggle-option.student {
    color: #6b7280;
}

/* Student mode (checked) */
.role-toggle-container.student-mode .role-toggle-option.teacher {
    color: #6b7280;
}

.role-toggle-container.student-mode .role-toggle-option.student {
    color: white;
}

.role-toggle-container.student-mode .role-toggle-slider {
    transform: translateX(100%);
}

/* Hide the old toggle styling */
#user-role-toggle + label > div {
    display: none;
}

/* Admin Tab Cards Styling */
.admin-tabs-container {
    padding: 1rem 0;
}

.admin-tab-card {
    border: none;
    cursor: pointer;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-tab-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.admin-tab-card:active {
    transform: translateY(0);
}

/* Color variations for different admin cards */
.admin-tab-card.bg-blue-500 {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.admin-tab-card.bg-green-500 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.admin-tab-card.bg-purple-500 {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.admin-tab-card.bg-orange-500 {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Back button container */
.back-button-container {
    margin-bottom: 1rem;
}

/* Teacher Tab Cards Styling */
.teacher-tabs-container {
    padding: 1rem 0;
}

.teacher-tab-card {
    border: none;
    cursor: pointer;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.teacher-tab-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.teacher-tab-card:active {
    transform: translateY(0);
}

/* Student Tab Cards Styling */
.student-tabs-container {
    padding: 1rem 0;
}

.student-tab-card {
    border: none;
    cursor: pointer;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-tab-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.student-tab-card:active {
    transform: translateY(0);
}

/* Responsive adjustments for all tab cards */
@media (max-width: 768px) {
    .admin-tabs-container .grid,
    .teacher-tabs-container .grid,
    .student-tabs-container .grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .admin-tab-card,
    .teacher-tab-card,
    .student-tab-card {
        min-height: 100px;
        padding: 0.75rem;
    }
    
    .admin-tab-card h3,
    .teacher-tab-card h3,
    .student-tab-card h3 {
        font-size: 1rem;
    }
    
    .admin-tab-card p,
    .teacher-tab-card p,
    .student-tab-card p {
        font-size: 0.75rem;
    }
    
    /* Single column for teacher and student on very small screens */
    .teacher-tabs-container .grid,
    .student-tabs-container .grid {
        grid-template-columns: 1fr;
    }
}

/* Notification badges on tab cards */
.student-tab-card .absolute,
.teacher-tab-card .absolute,
.admin-tab-card .absolute {
    z-index: 10;
    animation: pulse 2s infinite;
}

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

/* Ensure badges are visible on hover */
.student-tab-card:hover .absolute,
.teacher-tab-card:hover .absolute,
.admin-tab-card:hover .absolute {
    animation: none;
    transform: scale(1);
}
