/* Import modern Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f7fa;
    color: #2d3748;
    line-height: 1.6;
    font-size: 15px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.875rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

/* Sidebar - Modern Design with Flexbox */
/* Sidebar - Modern Design with Floating Pills */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px;
    /* Slightly wider for better spacing */
    background: linear-gradient(180deg, #0d9488 0%, #0f766e 40%, #115e59 100%);
    padding: 1.5rem 1rem;
    /* More padding on sides for floating look */
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08);
    /* Softer shadow */
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
}

/* Scrollbar refinement */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-header {
    padding: 0.5rem 0.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
}

.sidebar-header img {
    width: auto;
    height: auto;
    max-width: 100%;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-header img:hover {
    transform: scale(1.1) rotate(3deg);
}

.sidebar-header h3 {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 1.25rem;
    letter-spacing: -0.01em;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-section {
    padding: 1rem 1rem 0.75rem;
    font-size: 0.75rem !important;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
}

/* Links as Floating Pills */
.sidebar a {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.25rem;
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    border-radius: 14px;
    /* Rounded pill shape */
    border: 1px solid transparent;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar a i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
    margin-right: 0.85rem;
    transition: transform 0.3s ease;
    opacity: 0.9;
}

.sidebar a:hover i {
    transform: scale(1.15);
    opacity: 1;
}

/* Active State - distinct white pill */
.sidebar a.active {
    background: #ffffff;
    color: #0d9488;
    /* Match sidebar primary color */
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(5px);
    border: none;
    /* remove left border */
}

/* Active Icon */
.sidebar a.active i {
    color: #0f766e;
    transform: scale(1.1);
}

/* Dot indicator for active item */
.sidebar a.active::after {
    display: none;
    /* Remove old dot */
}

/* New Dot inside the white card */
.sidebar a.active::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #0f766e;
    border-radius: 50%;
    opacity: 0.6;
}

/* Logout specific */
.sidebar .logout-link {
    margin-top: auto;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.sidebar .logout-link:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 270px;
    /* Updated width */
    right: 0;
    height: 70px;
    background: #ffffff;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 999;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a202c;
    letter-spacing: -0.02em;
}

/* Content Area */
.content {
    margin-left: 270px;
    /* Updated width */
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.125rem;
    color: #1a202c;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #115e59 0%, #0f766e 100%);
    box-shadow: 0 4px 8px rgba(15, 118, 110, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-warning {
    background-color: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Tables */
.table {
    font-size: 0.9375rem;
}

.table thead th {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    padding: 1rem 0.75rem;
}

.table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    color: #374151;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.form-control,
.form-select {
    font-family: 'Inter', sans-serif;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #1a202c;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1.25rem 1.5rem;
}

/* Login Page Specific Styles */
.login-card {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
}

.login-card h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.75rem;
    color: #0f766e;
    margin-bottom: 0.5rem;
}

.text-teal {
    color: #0f766e;
}

/* Utility Classes */
.text-muted {
    color: #9ca3af !important;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 270px;
        left: -270px;
        transition: left 0.3s ease;
        z-index: 1050;
    }

    .sidebar.show {
        left: 0;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    }

    /* Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .sidebar-header h3,
    .sidebar a span {
        display: block !important;
    }

    .navbar {
        left: 0;
        width: 100%;
        padding-left: 1rem;
    }

    .content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

/* Language Switcher */
.lang-switcher {
    position: fixed;
    top: 1rem;
    right: 2rem;
    z-index: 1100;
}

.lang-toggle {
    background: white;
    border-radius: 50px;
    padding: 0.25rem;
    display: flex;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.lang-option {
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-option.active {
    background: #0f766e;
    color: white;
    box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
}

.lang-option:hover:not(.active) {
    background: #f1f5f9;
    color: #334155;
}

/* RTL Support */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .sidebar {
    left: auto;
    right: 0;
}

body.rtl .content {
    margin-left: 0;
    margin-right: 270px;
    /* Updated width */
}

body.rtl .lang-switcher {
    right: auto;
    left: 2rem;
}

body.rtl .sidebar-header {
    text-align: center;
}

@media (max-width: 768px) {
    body.rtl .content {
        margin-right: 0;
        margin-left: 0;
    }

    body.rtl .sidebar {
        left: auto;
        right: -270px;
        width: 270px;
    }

    body.rtl .sidebar.show {
        right: 0;
    }

    body.rtl .navbar {
        right: 0;
        left: 0;
        padding-right: 1rem;
    }
}

/* Student Card Modern Enhancements */
.group-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.group-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.bg-soft-primary {
    background-color: rgba(13, 148, 136, 0.1) !important;
    color: #0f766e !important;
}

.student-card .student-avatar {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.student-card .btn {
    transition: all 0.2s;
}

.student-card .btn:hover {
    transform: scale(1.1);
}