/* Souhir.Net - modern look for the public site and the student space.
   Styles only: loaded from menu.php and etudiant/menu.php. */

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

:root {
    --sn-primary: #2563eb;
    --sn-primary-dark: #1d4ed8;
    --sn-primary-soft: #eff4ff;
    --sn-accent: #7c3aed;
    --sn-success: #16a34a;
    --sn-danger: #dc2626;
    --sn-text: #1f2937;
    --sn-muted: #6b7280;
    --sn-border: #e5e7eb;
    --sn-bg: #f4f6fb;
    --sn-card: #ffffff;
    --sn-radius: 14px;
    --sn-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
}

html, body {
    background: var(--sn-bg) !important;
}
body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
    color: var(--sn-text);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 {
    font-weight: 700;
    letter-spacing: -.01em;
    color: #111827;
}
a {
    color: var(--sn-primary);
}

/* ---------- Navbar ---------- */
.site-nav {
    background: rgba(255, 255, 255, .92) !important;
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--sn-border);
    box-shadow: 0 1px 8px rgba(16, 24, 40, .05);
    padding: .5rem 0;
    z-index: 1030;
}
.site-nav .navbar-brand img {
    width: 92px;
    height: auto;
}
.site-nav .navbar-nav .nav-link {
    color: #374151 !important;
    font-family: "Inter", sans-serif;
    font-size: .95rem;
    font-weight: 600;
    padding: .5rem .85rem !important;
    border-radius: 999px;
    transition: background-color .15s ease, color .15s ease;
}
.site-nav .navbar-nav .nav-link:hover,
.site-nav .navbar-nav .nav-link:focus,
.site-nav .navbar-nav .nav-link.show {
    color: var(--sn-primary) !important;
    background: var(--sn-primary-soft);
}
.site-nav .navbar-nav .nav-link i {
    margin-right: .25rem;
    opacity: .8;
}
.site-nav .navbar-nav .nav-item {
    margin: 0 .1rem;
}
.site-nav .navbar-toggler {
    border: 1px solid var(--sn-border);
    border-radius: 10px;
}
.site-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgb(55, 65, 81)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.site-nav .dropdown-menu {
    border: 1px solid var(--sn-border);
    border-radius: 12px;
    box-shadow: var(--sn-shadow);
    padding: .4rem;
}
.site-nav .dropdown-item {
    border-radius: 8px;
    padding: .45rem .8rem;
    font-weight: 500;
}
.site-nav .dropdown-item:hover {
    background: var(--sn-primary-soft);
    color: var(--sn-primary);
}
.site-nav .btn-danger {
    border-radius: 999px;
    padding: .4rem 1rem;
    font-weight: 600;
    margin-left: .35rem;
}
@media (max-width: 991.98px) {
    .site-nav .navbar-collapse {
        padding: .5rem 0 .75rem;
    }
    .site-nav .btn-danger {
        margin: .5rem 0 0;
    }
}

/* ---------- Generic building blocks ---------- */
.sn-page {
    padding-top: 2rem;
    padding-bottom: 3rem;
}
.sn-card {
    background: var(--sn-card);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius);
    box-shadow: var(--sn-shadow);
    padding: 1.75rem;
}
.sn-card-title {
    font-size: 1.35rem;
    margin-bottom: .25rem;
}
.sn-card-subtitle {
    color: var(--sn-muted);
    margin-bottom: 1.25rem;
}
.sn-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sn-primary);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 1.75rem 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--sn-border);
}
.empty-state {
    background: var(--sn-card);
    border: 1px dashed #cbd5e1;
    border-radius: var(--sn-radius);
    color: var(--sn-muted);
    padding: 2.5rem 1rem;
    margin: 2rem 0;
    text-align: center;
    font-weight: 500;
}

/* ---------- Forms & buttons ---------- */
.form-control,
.form-select {
    border-radius: 10px;
    border-color: #d1d5db;
    padding: .6rem .85rem;
}
.form-control:focus,
.form-select:focus {
    border-color: #93b4f7;
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
}
.form-label,
.form-group > label,
.col-form-label {
    font-weight: 600;
    color: #374151;
}
.form-group {
    margin-bottom: 1rem;
}
.form-check-input:checked {
    background-color: var(--sn-primary);
    border-color: var(--sn-primary);
}
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: transform .1s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:active {
    transform: translateY(1px);
}
.btn-primary,
.btn-info {
    background: var(--sn-primary);
    border-color: var(--sn-primary);
    color: #fff;
}
.btn-primary:hover,
.btn-info:hover {
    background: var(--sn-primary-dark);
    border-color: var(--sn-primary-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .25);
}
.alert {
    border-radius: 12px;
    border: 0;
    box-shadow: var(--sn-shadow);
}

/* ---------- Home / login ---------- */
.sn-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, var(--sn-primary) 55%, var(--sn-accent) 100%);
    color: #fff;
    padding: 3.5rem 0;
}
.sn-hero .sn-hero-content,
.sn-hero .sn-hero-content * {
    color: #fff;
}
.sn-hero .sn-hero-content {
    font-size: 1.05rem;
    line-height: 1.7;
}
.sn-hero .sn-hero-content h1,
.sn-hero .sn-hero-content h2,
.sn-hero .sn-hero-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.sn-hero .sn-badge {
    display: inline-block;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .3rem .8rem;
    margin-bottom: 1.25rem;
}
.sn-login-card {
    color: var(--sn-text);
}
.sn-login-card .text-danger label,
.sn-login-card .text-danger {
    color: var(--sn-danger) !important;
    font-weight: 500;
}
.sn-password {
    position: relative;
}
.sn-password .form-control {
    padding-right: 2.75rem;
}
.sn-password #togglePassword {
    position: absolute;
    right: .9rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    color: var(--sn-muted);
}

/* ---------- Course lists (public) ---------- */
.sn-table-card {
    background: var(--sn-card);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius);
    box-shadow: var(--sn-shadow);
    overflow: hidden;
}
.sn-table-card .table {
    margin-bottom: 0;
}
.sn-table-card .table thead tr,
.sn-table-card .table thead th {
    background: #f8fafc !important;
    color: var(--sn-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--sn-border);
}
.sn-table-card .table td {
    padding: .9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.sn-table-card .table tbody tr:hover {
    background: #fafbff;
}

/* ---------- Student: TD tables ---------- */
table.td-table {
    background: var(--sn-card);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius);
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: var(--sn-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}
table.td-table tr {
    background-color: transparent;
    border: 0;
}
table.td-table thead th {
    background: #f8fafc;
    color: var(--sn-muted);
    font-size: .75rem;
    border-bottom: 1px solid var(--sn-border);
}
table.td-table td {
    border-bottom: 1px solid #f1f5f9;
    font-size: .92rem;
    vertical-align: middle;
}
table.td-table tbody tr:last-child td {
    border-bottom: 0;
}
table.td-table tbody tr:hover {
    background: #fafbff;
}
table.td-table a {
    display: inline-block;
    margin: .2rem 0;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: var(--sn-primary-soft);
    color: var(--sn-primary);
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
}
table.td-table a:hover {
    background: var(--sn-primary);
    color: #fff;
}
.td-title {
    margin: 2rem 0 1rem;
    font-size: 1.6rem;
}
@media screen and (max-width: 600px) {
    table.td-table {
        border: 0;
        box-shadow: none;
        background: transparent;
    }
    table.td-table tr {
        background: var(--sn-card);
        border: 1px solid var(--sn-border);
        border-radius: 12px;
        margin-bottom: 1rem;
        box-shadow: var(--sn-shadow);
        overflow: hidden;
    }
}

/* ---------- Student: profile ---------- */
.student-profile .card {
    border: 1px solid var(--sn-border) !important;
    border-radius: var(--sn-radius) !important;
    box-shadow: var(--sn-shadow) !important;
}
.student-profile .card .card-header {
    padding-top: 1.25rem;
}
.student-profile .card .card-header .profile_img {
    border: 6px solid var(--sn-primary-soft) !important;
    box-shadow: 0 0 0 2px #c7d7fb;
}
.student-profile .card h3 {
    color: #111827;
}
.student-profile .card p,
.student-profile .table th,
.student-profile .table td {
    color: var(--sn-text) !important;
}
.student-profile .card-body p {
    padding: .35rem 0;
    border-bottom: 1px dashed var(--sn-border);
}
.student-profile .card-body p:last-child {
    border-bottom: 0;
}
.student-profile .table th {
    background: #f8fafc;
    font-weight: 600;
}
.student-profile .table-bordered > :not(caption) > * > * {
    border-color: var(--sn-border);
}
.sn-wait {
    max-width: 760px;
    margin: 3rem auto;
    text-align: center;
}
.sn-wait h1 {
    font-size: 1.35rem !important;
    line-height: 1.6;
    font-weight: 600;
}

/* ---------- Student: upload forms ---------- */
body .form-box {
    max-width: 760px;
    margin: 2rem auto 3rem;
    padding: 2rem;
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius);
    box-shadow: var(--sn-shadow);
}
body .form-box h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
body .form-box p {
    color: #9a3412 !important;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: .95rem;
}
body .form-box .btn {
    padding: .7rem 1rem;
}
.upload-card {
    max-width: 760px;
    margin: 2rem auto 3rem;
    background: var(--sn-card);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius);
    box-shadow: var(--sn-shadow);
    padding: 2rem;
}
.upload-card input[type="file"] {
    display: block;
    width: 100%;
    padding: .6rem;
    margin-bottom: 1rem;
    border: 1px dashed #93b4f7;
    border-radius: 10px;
    background: var(--sn-primary-soft);
}
.upload-card input[type="submit"] {
    background: var(--sn-primary);
    border: 0;
    color: #fff;
    font-weight: 600;
    padding: .65rem 1.5rem;
    border-radius: 10px;
}
.upload-card input[type="submit"]:hover {
    background: var(--sn-primary-dark);
}

/* ---------- Footer ---------- */
.sn-footer {
    color: var(--sn-muted);
    font-size: .875rem;
    text-align: center;
    padding: 2rem 0;
}
.row > .sn-section-title {
    width: auto;
    margin-left: calc(var(--bs-gutter-x) * .5);
    margin-right: calc(var(--bs-gutter-x) * .5);
    padding-left: 0;
    padding-right: 0;
}

/* ---------- Small polish (round 2) ---------- */
html {
    scroll-behavior: smooth;
}
::selection {
    background: #c7d7fb;
}
.sn-hero {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
}
.sn-hero > .container {
    width: 100%;
}
.sn-card {
    transition: box-shadow .2s ease;
}
.sn-card:hover {
    box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 12px 32px rgba(16, 24, 40, .09);
}
.sn-login-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sn-primary-soft);
    color: var(--sn-primary);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}
.sn-input-icon {
    position: relative;
}
.sn-input-icon > i:first-child {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    z-index: 2;
}
.sn-input-icon .form-control {
    padding-left: 2.5rem;
}
.sn-input-icon:focus-within > i:first-child {
    color: var(--sn-primary);
}
.sn-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #9ca3af;
    font-size: .8rem;
    text-transform: uppercase;
    margin: 1rem 0;
}
.sn-divider::before,
.sn-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--sn-border);
}
.btn-outline-primary {
    color: var(--sn-primary);
    border-color: #bfd0fb;
}
.btn-outline-primary:hover {
    background: var(--sn-primary);
    border-color: var(--sn-primary);
}
/* current page in the menu */
.site-nav .navbar-nav .nav-link.active {
    color: var(--sn-primary) !important;
    background: var(--sn-primary-soft);
}
/* zebra rows */
.sn-table-card .table tbody tr:nth-child(even),
table.td-table tbody tr:nth-child(even) {
    background: #fbfcfe;
}
/* focus ring for keyboard users */
a:focus-visible,
.btn:focus-visible {
    outline: 2px solid #93b4f7;
    outline-offset: 2px;
}

/* ---------- Home: long welcome text (round 3) ---------- */
.sn-hero {
    align-items: flex-start;
    padding: 2.5rem 0 3rem;
}
/* the welcome text comes from the admin editor: keep it at a readable size */
.sn-hero .sn-hero-content {
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.sn-hero .sn-hero-content * {
    font-size: inherit !important;
    line-height: inherit !important;
    background: transparent !important;
    max-width: 100%;
}
.sn-hero .sn-hero-content h1,
.sn-hero .sn-hero-content h2 {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
    margin-bottom: .75rem;
}
.sn-hero .sn-hero-content h3,
.sn-hero .sn-hero-content h4 {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
    margin-bottom: .5rem;
}
.sn-hero .sn-hero-content p {
    margin-bottom: .75rem;
}
.sn-hero .sn-hero-content img {
    height: auto;
    border-radius: 10px;
}
.sn-hero .sn-hero-content table {
    display: block;
    overflow-x: auto;
}
@media (min-width: 992px) {
    /* long text scrolls inside its panel, the login card stays in view */
    .sn-hero .sn-hero-content {
        max-height: 62vh;
        overflow-y: auto;
        padding: 1.25rem 1.5rem;
        background: rgba(255, 255, 255, .08);
        border: 1px solid rgba(255, 255, 255, .15);
        border-radius: var(--sn-radius);
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .45) transparent;
    }
    .sn-login-col {
        position: sticky;
        top: 96px;
    }
}
@media (max-width: 991.98px) {
    .sn-hero {
        padding-top: 1.5rem;
    }
}

/* ---------- Small polish (round 4) ---------- */
/* menu: keep icon and label on one line */
.site-nav .navbar-nav .nav-link,
.site-nav .btn {
    white-space: nowrap;
}
.site-nav-student .navbar-nav .nav-link {
    padding: .5rem .7rem !important;
    font-size: .92rem;
}
@media (max-width: 1199.98px) {
    .site-nav-student .navbar-collapse {
        padding: .5rem 0 .75rem;
    }
    .site-nav-student .btn-danger {
        margin: .5rem 0 0;
    }
}
.site-nav .navbar-toggler:focus {
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
}
/* profile: space between label and value */
.student-profile .card-body p strong {
    margin-right: .35rem;
}
/* upload page */
.upload-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}
.upload-title i {
    color: var(--sn-primary);
    margin-right: .35rem;
}
.upload-card input[type="file"] {
    color: var(--sn-text) !important;
    margin-bottom: .4rem;
}
.upload-hint {
    display: block;
    color: var(--sn-muted);
    margin-bottom: 1rem;
}
/* medium-large screens: 8 links + logout must fit on one line */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .site-nav-student .navbar-nav .nav-link {
        padding: .45rem .55rem !important;
        font-size: .88rem;
    }
    .site-nav-student .navbar-nav .nav-link i.fa-book {
        display: none;
    }
    .site-nav-student .btn-danger {
        padding: .35rem .85rem;
        font-size: .88rem;
    }
}
