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

:root {
    /* Color Palette */
    --primary: #4e73df;
    --primary-dark: #224abe;
    --secondary: #858796;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --light: #f8f9fc;
    --dark: #5a5c69;
    --darker: #2e303e;
    /* New dark background */

    /* Layout */
    --navbar-height: 70px;
    --card-border-radius: 0.75rem;
    --btn-border-radius: 0.5rem;

    /* Shadows */
    --shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #444;
    background-color: var(--light);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: var(--darker);
}

/* CARDS */
.card {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    /* transform: translateY(-2px); Disable strictly for interactivity, maybe too much for admin */
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

/* BUTTONS */
.btn {
    border-radius: var(--btn-border-radius);
    font-weight: 500;
    padding: 0.375rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
}

/* NAVBAR */
.navbar-custom {
    background: rgba(255, 255, 255, 0.85);
    /* More transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* FORMS */
.form-control,
.form-select {
    border-radius: 0.5rem;
    border: 1px solid #d1d3e2;
    padding: 0.5rem 1rem;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25);
    border-color: var(--primary);
}

/* ALERTS */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

/* RESPONSIVE UTILS */
@media (max-width: 768px) {
    .card-container {
        width: 100% !important;
        min-width: unset !important;
        padding: 10px;
    }

    /* Improve table scrolling on mobile if not already handled */
    .table-responsive-stack {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* ORDUTEGIAK MOBILE VIEW (Hybrid approach) */
.mobile-schedule-list {
    display: none;
    /* Hidden by default, shown on mobile via media query or helper class d-md-none */
}

@media (max-width: 992px) {

    /* Hide the complex absolute positioning table on smaller screens */
    #ordutegitaula,
    .table-ordutegia-container {
        display: none !important;
    }

    .mobile-schedule-list {
        display: block;
    }

    .schedule-card-mobile {
        background: white;
        margin-bottom: 1rem;
        border-left: 5px solid var(--primary);
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: var(--shadow-sm);
    }

    .schedule-time {
        font-weight: bold;
        color: var(--dark);
        font-size: 1.1em;
    }

    .schedule-day-header {
        background: var(--light);
        padding: 0.5rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
        border-radius: 0.25rem;
        font-weight: bold;
        text-transform: uppercase;
        color: var(--secondary);
    }
}

/* AUTH SPLIT SCREEN V5 (Inspired by Model) */
.auth-container {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    background-color: white;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
}

.auth-banner {
    flex: 1.25;
    background: linear-gradient(145deg, #4c6ef5 0%, #1c3dad 100%);
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Curve lines pattern inspired by model */
.auth-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.07) 0%, transparent 50%);
    z-index: 1;
}

.auth-banner::after {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cpath d='M0,500 C200,400 400,600 600,500 C800,400 1000,600 1200,500' stroke='rgba(255,255,255,0.05)' fill='none' stroke-width='2'/%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

.auth-banner-content {
    position: relative;
    z-index: 2;
}

.auth-banner-tag {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: white;
}

.auth-banner-logo-container {
    background: white;
    padding: 1.5rem 2rem !important;
    border-radius: 3rem;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
    display: inline-block !important;
    margin-bottom: 2.5rem;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: auto !important;
    max-width: 95% !important;
    line-height: 0;
}

.auth-banner-logo-container:hover {
    transform: scale(1.02);
}

.auth-banner-logo {
    height: 38vh !important;
    max-height: 480px !important;
    width: auto !important;
    max-width: 100% !important;
    display: block;
    object-fit: contain;
}

.auth-banner-desc {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 480px;
    line-height: 1.5;
    font-weight: 500;
}

.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
}

.auth-logo-top {
    margin-bottom: 3rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-divider {
    display: flex;
    align-items: center;
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.login-divider span {
    padding: 0 1rem;
}


/* Modern minimalist inputs */
.form-input-modern {
    border: none;
    border-bottom: 2px solid #e9ecef;
    border-radius: 0;
    padding: 0.75rem 0;
    background-color: transparent !important;
    transition: border-color 0.2s;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.form-input-modern:focus {
    box-shadow: none;
    border-color: #4c6ef5;
}

.btn-auth-primary {
    background-color: #1a1a1a;
    color: white;
    border: none;
    padding: 0.9rem;
    font-weight: 600;
    border-radius: 0.5rem;
    width: 100%;
    margin: 1rem 0;
    transition: background-color 0.2s;
}

.btn-auth-primary:hover {
    background-color: #333;
    color: white;
}

.btn-google-auth {
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 1.1rem 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0f172a;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-size: 1.1rem;
}

.btn-google-auth svg {
    margin-right: 14px;
    width: 24px;
    height: 24px;
}

.btn-google-auth:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.btn-google-auth:active {
    background-color: #e2e8f0;
    transform: translateY(0);
}

.auth-footer-links {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Responsive Mobile Branding */
.auth-mobile-header {
    display: none;
    text-align: center;
    padding: 2.5rem 1rem 1rem 1rem;
    width: 100%;
    background: transparent;
}

.auth-mobile-logo-container {
    background: white;
    padding: 1.5rem 2.5rem;
    border-radius: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    display: inline-block;
    margin-bottom: 1.5rem;
}

.auth-mobile-logo {
    max-height: 160px;
    width: auto;
    object-fit: contain;
}

.auth-mobile-school-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

@media (max-width: 991.98px) {
    .auth-banner {
        display: none;
    }

    .auth-mobile-header {
        display: block;
    }

    .auth-form-side {
        padding: 1rem;
        display: block;
        /* Ensure it flows below header */
        overflow-y: auto;
    }

    .auth-form-card {
        padding: 2rem 1.5rem;
        margin: 0 auto;
        box-shadow: none;
    }

    .auth-title {
        font-size: 2.2rem !important;
        margin-bottom: 2rem !important;
    }
}

.auth-form-card .form-group input:not([type="checkbox"]),
.auth-form-card .mb-3 input:not([type="checkbox"]),
.auth-form-card .mb-4 input:not([type="checkbox"]),
.auth-form-card input.form-control:not([type="checkbox"]) {
    border: none;
    border-bottom: 2px solid #e9ecef;
    border-radius: 0;
    padding: 0.75rem 0;
    background-color: transparent !important;
    transition: border-color 0.2s;
    font-size: 1rem;
    box-shadow: none !important;
}

.auth-form-card input.form-control:not([type="checkbox"]):focus {
    border-color: #3b5bdb;
}

/* Ensure checkboxes are visible and properly styled */
.auth-form-card input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin-right: 10px;
    cursor: pointer;
    vertical-align: middle;
    accent-color: #3b5bdb;
}

.auth-form-card input[type="checkbox"]:focus {
    outline: 2px solid rgba(59, 155, 219, 0.4);
    outline-offset: 2px;
}

.auth-form-card label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

/* LANDING PAGES PREMIUM UI */
.landing-hero {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.landing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.landing-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2.5rem;
    padding: 3.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

/* Calendar Grid Dashboard Styles */
.calendar-month-box {
    min-height: auto;
    transition: all 0.3s ease;
}

.calendar-month-box:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

.calendar-table th {
    text-align: center;
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    padding-bottom: 12px;
    font-weight: 800;
}

.calendar-table td {
    padding: 2px;
}

.day-box {
    width: 30px;
    height: 30px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
    border: 2px solid transparent;
}

.day-box:hover {
    background-color: #f1f5f9;
    transform: scale(1.1);
    z-index: 10;
}

/* Event Highlights */
.day-box.text-primary.fw-bold {
    background-color: transparent !important;
    color: var(--primary) !important;
    border-color: transparent !important;
    font-size: 1.1rem;
    font-weight: 800 !important;
    text-decoration: none !important;
}

.day-box.bg-danger {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

.day-box.bg-success {
    background-color: #22c55e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgb(34 197 94 / 0.4);
}

.day-box.bg-success.text-primary.fw-bold {
    color: #003366 !important;
    /* Dark Blue for readability on Green */
    background-color: #22c55e !important;
}

.btn-premium-glow {
    background: linear-gradient(45deg, #4c6ef5, #1c3dad);
    color: white !important;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-radius: 100px;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(76, 110, 245, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none !important;
    display: inline-block;
}

.btn-premium-glow:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(76, 110, 245, 0.6);
}

.btn-premium-glow:active {
    transform: translateY(0) scale(0.98);
}

.landing-school-name {
    color: white;
    font-size: 3.5rem;
    font-weight: 800;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.landing-logo-img {
    max-height: 250px;
    width: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

@media (max-width: 768px) {
    .landing-school-name {
        font-size: 2.2rem;
    }

    .glass-card {
        padding: 2rem;
    }
}

.table-management td {
    vertical-align: middle;
}

/* Modern Table Inputs */
.table-input-modern {
    width: 100%;
    border: 1px solid transparent;
    background-color: transparent;
    padding: 0.1rem 0.4rem;
    font-size: 0.85rem;
    border-radius: 3px;
    transition: all 0.2s ease;
    outline: none;
}

.table-input-modern:focus,
.table-input-modern:hover {
    background-color: white;
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-input-modern:focus {
    border-color: #4c6ef5;
    box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.15);
}

/* Ultra Compact variant for high-density tables */
.table-input-compact {
    width: 100%;
    border: 1px solid transparent;
    background-color: transparent;
    padding: 2px 4px;
    height: 28px;
    font-size: 0.85rem;
    border-radius: 2px;
    transition: all 0.2s ease;
    outline: none;
}

/* Standardize small form controls height for grid alignment */
.form-control-sm,
.form-select-sm,
.input-group-sm>.form-control,
.input-group-sm>.form-select,
.input-group-sm>.input-group-text {
    min-height: 36px;
    font-size: 0.875rem;
}

.table-input-compact:focus,
.table-input-compact:hover {
    background-color: white;
    border-color: #dee2e6;
}

.table-input-compact:focus {
    border-color: #4c6ef5;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================
   ATTENDANCE (ASISTENTZIA) SPECIFIC STYLES
   ============================================ */

/* Fix for attendance select dropdowns - ensure text is not truncated */
.table .form-select-sm,
.table-responsive .form-select-sm,
td .form-select-sm {
    height: auto !important;
    min-height: 38px !important;
    padding: 0.25rem 2rem 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* Ensure table cells have enough padding */
.table-sm td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

/* ============================================
   ATTENDANCE PAGE RESPONSIVE STYLES
   ============================================ */

/* Mobile-first responsive layout for attendance header */
@media (max-width: 768px) {

    /* Stack header columns on mobile */
    .container-fluid>.row>.col-4,
    .container-fluid>.row>.col-3,
    .container-fluid>.row>.col-5 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    /* Adjust heading size */
    .container-fluid h1 {
        font-size: 1.5rem;
    }

    /* Stack info columns */
    .container-fluid h5.text-info {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    /* Full-width tables */
    .table-responsive {
        margin: 0 -0.75rem;
    }

    /* Smaller fonts in tables */
    .table-sm {
        font-size: 0.8rem;
    }

    .table-sm .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    /* Stack day buttons vertically on small screens */
    .row.bg-light .col.text-center {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 0.5rem;
    }

    /* Month selector full width */
    .row.bg-light select.form-select-lg {
        width: 100% !important;
        font-size: 1.25rem !important;
    }
}

@media (max-width: 576px) {

    /* Even smaller screens */
    .row.bg-light .col.text-center {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Compact card body */
    .card-body {
        padding: 0.5rem;
    }

    /* Smaller heading in cards */
    .card h2 {
        font-size: 1.1rem;
    }

    /* Compact selects */
    .table .form-select-sm,
    td .form-select-sm {
        min-height: 34px !important;
        padding: 0.2rem 1.5rem 0.2rem 0.4rem !important;
        font-size: 0.75rem !important;
    }
}