/* CTEF Custom Styles */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary-blue: #2563eb;
    --sky-blue: #0ea5e9;
    --bright-yellow: #fbbf24;
    --light-bg: #f0f9ff;
    --dark-text: #1e293b;
}

/* ============================================
   BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: var(--dark-text);
    margin: 0;
}

body.has-mobile-bottom-nav {
    padding-bottom: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 3px solid var(--bright-yellow);
    outline-offset: 2px;
}

.container {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 20px 0;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    padding: 0.75rem 0;
    border-bottom: 3px solid rgba(251, 191, 36, 0.3);
}

.navbar .container {
    padding: 0 1rem;
}

.navbar-brand {
    font-size: 1.8rem;
    letter-spacing: 2px;
    font-weight: 800;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar-brand img {
    max-height: 45px;
    width: auto;
    border-radius: 50%;
    -o-object-fit: contain;
    object-fit: contain;
}

.navbar-dark .navbar-nav .nav-link {
    color: white !important;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    padding: 0.5rem 0.75rem !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--bright-yellow) !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.navbar-dark .navbar-nav .nav-link.active {
    color: var(--bright-yellow) !important;
    background-color: rgba(255, 255, 255, 0.14);
    border-radius: 6px;
}

.navbar-dark .navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--bright-yellow);
    bottom: 0;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    -webkit-transition: width 0.3s ease;
    transition: width 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover::after {
    width: 80%;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.navbar-collapse {
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.navbar-actions {
    min-width: 0;
}

.header-language-dropdown .nav-link {
    margin: 0;
    padding: 0.5rem 0.8rem !important;
}

.mobile-bottom-nav {
    display: none;
}

.mobile-bottom-nav__link {
    text-decoration: none;
}

.mobile-bottom-nav__label {
    display: block;
}

.table-view-toggle-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.table-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    background: #f8fbff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.table-view-toggle__button {
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    -webkit-transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.table-view-toggle__button.is-active {
    color: white;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.table-view-toggle__button i {
    font-size: 0.95rem;
    line-height: 1;
}

.table-view-density {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 600;
}

.table-view-density[hidden] {
    display: none !important;
}

.table-view-density label {
    white-space: nowrap;
}

.table-view-density select {
    min-width: 82px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    background: white;
}

.table-view-toggle-ready[hidden],
.table-card-view[hidden] {
    display: none !important;
}

.table-card-view {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(var(--table-card-columns, 1), minmax(0, 1fr));
    --table-card-font-size: 0.95rem;
    --table-card-label-size: 0.72rem;
    --table-card-title-size: 1rem;
}

.table-card-item {
    background: white;
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.table-card-item.is-hidden {
    display: none;
}

.table-card-item__header {
    padding: 0.5rem 0.75rem 0.4rem;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.09) 0%, rgba(37, 99, 235, 0.01) 100%);
    border-bottom: 1px solid rgba(37, 99, 235, 0.08);
}

.table-card-item__title {
    margin: 0;
    font-size: var(--table-card-title-size);
    font-weight: 700;
    color: var(--dark-text);
    word-break: break-word;
    line-height: 1.25;
}

.table-card-item__body {
    padding: 0.5rem 0.75rem;
    flex: 1 1 auto;
}

.table-card-item__grid {
    display: grid;
    gap: 0.4rem;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.table-card-item__row {
    display: grid;
    gap: 0.15rem;
    padding: 0.3rem 0.5rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(241, 245, 249, 0.7) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 6px;
}

.table-card-item__label {
    font-size: var(--table-card-label-size);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.table-card-item__value {
    color: var(--dark-text);
    word-break: break-word;
    font-size: var(--table-card-font-size);
    line-height: 1.35;
}

.table-card-item__value .btn,
.table-card-item__actions .btn {
    margin: 0;
}

.table-card-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem 0.5rem;
    border-top: 1px solid rgba(37, 99, 235, 0.08);
    background: rgba(248, 250, 252, 0.8);
}

.table-card-item__actions form {
    margin: 0;
}

.table-card-item__actions .d-inline,
.table-card-item__actions .d-inline-flex,
.table-card-item__actions .d-flex {
    display: inline-flex !important;
}

.table-card-item--empty .table-card-item__body {
    padding-top: 0.75rem;
}

.table-card-item__empty {
    color: #64748b;
    text-align: center;
}

.table-card-view[data-card-columns="2"] {
    --table-card-font-size: 0.96rem;
    --table-card-label-size: 0.72rem;
    --table-card-title-size: 1.02rem;
}

.table-card-view[data-card-columns="3"],
.table-card-view[data-card-columns="4"] {
    --table-card-font-size: 0.9rem;
    --table-card-label-size: 0.69rem;
    --table-card-title-size: 0.98rem;
}

.table-card-view[data-card-columns="5"],
.table-card-view[data-card-columns="6"] {
    --table-card-font-size: 0.84rem;
    --table-card-label-size: 0.64rem;
    --table-card-title-size: 0.9rem;
}

.table-card-view[data-card-columns="7"],
.table-card-view[data-card-columns="8"],
.table-card-view[data-card-columns="9"],
.table-card-view[data-card-columns="10"] {
    --table-card-font-size: 0.78rem;
    --table-card-label-size: 0.58rem;
    --table-card-title-size: 0.82rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    margin-bottom: 20px;
    border: none !important;
    border-radius: 12px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-animation: fadeInUp 0.4s ease-out both;
    animation: fadeInUp 0.4s ease-out both;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%);
    color: white;
    font-weight: bold;
    border-radius: 12px 12px 0 0 !important;
    border: none !important;
    padding: 1.2rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #1e40af 0%, #0369a1 100%);
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: white;
}

.btn-secondary {
    background-color: var(--sky-blue);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: white;
}

.btn-secondary:hover {
    background-color: #0284c7;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
    color: white;
}

.btn-success {
    background-color: #10b981;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: white;
}

.btn-danger {
    background-color: #ef4444;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    color: white;
}

.btn-warning {
    background-color: var(--bright-yellow);
    color: var(--dark-text);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background-color: #f59e0b;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    color: var(--dark-text);
}

/* ============================================
   FORMS
   ============================================ */
.form-label {
    font-weight: 600;
    color: var(--dark-text);
}

.form-control,
.form-select {
    border: 2px solid #e0f2fe;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

textarea.form-control {
    border-radius: 8px;
    resize: vertical;
}

.required::after {
    content: " *";
    color: #ef4444;
}

/* ============================================
   ALERTS
   ============================================ */
.alert, .alert-disply, .alert-displa, .alert-display {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 10px;
}

.alert-info    { background-color: #e0f2fe; color: #0369a1; }
.alert-success { background-color: #dcfce7; color: #166534; }
.alert-warning { background-color: #fef3c7; color: #92400e; }
.alert-danger  { background-color: #fee2e2; color: #991b1b; }

/* ============================================
   TABLES
   ============================================ */
.table {
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
}

.table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%);
    color: #111827;
}

.table thead th,
.table thead td {
    color: #111827 !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(14, 165, 233, 0.05);
}

.table-hover tbody tr:hover > * {
    background-color: rgba(14, 165, 233, 0.1);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 0.5em 1em;
    border-radius: 20px;
    font-weight: 600;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination { margin-top: 20px; }

.pagination .page-link {
    color: var(--primary-blue);
    border-color: #e0f2fe;
}

.pagination .page-link:hover {
    background-color: var(--light-bg);
    border-color: var(--primary-blue);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

/* ============================================
   DROPDOWN
   ============================================ */
#langDropdown {
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: white !important;
    font-weight: 500;
}

#langDropdown:hover {
    color: var(--bright-yellow) !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.dropdown-menu {
    min-width: 180px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.dropdown-menu .dropdown-item {
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    color: var(--dark-text);
}

.dropdown-menu .dropdown-item:hover {
    background-color: var(--light-bg);
    color: var(--primary-blue);
}

/* ============================================
   DASHBOARD CARDS
   ============================================ */
.dashboard-card {
    text-align: center;
    padding: 30px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    background: white;
    border-radius: 12px;
    border-top: 4px solid var(--primary-blue);
}

.dashboard-card:hover {
    -webkit-transform: translateY(-5px);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
}

.dashboard-card i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: white; /* fallback for Chrome */
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%);
    color: white;
    padding: 2rem 0;
}

.footer-social-link {
    font-size: 1.5rem;
    -webkit-transition: opacity 0.2s ease, -webkit-transform 0.2s ease;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-block;
    color: white;
}

.footer-social-link:hover {
    opacity: 0.75;
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    color: white;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.2);
    z-index: 1050;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%);
    color: white;
    border: none;
    border-radius: 12px 12px 0 0;
}

.modal-header .btn-close {
    -webkit-filter: brightness(0) invert(1);
    filter: brightness(0) invert(1);
}

/* ============================================
   SUBJECT SELECTION
   ============================================ */
.subject-checkbox {
    margin: 10px 0;
    padding: 15px;
    border: 2px solid #e0f2fe;
    border-radius: 10px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    background-color: white;
}

.subject-checkbox:hover {
    background-color: #f0f9ff;
    border-color: var(--sky-blue);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.subject-checkbox input[type="checkbox"] {
    margin-right: 10px;
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
    accent-color: var(--primary-blue);
}

.tamil-level-select {
    margin-left: 30px;
    margin-top: 10px;
    display: inline-block;
    min-width: 200px;
}

.fee-summary {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--bright-yellow);
}

/* ============================================
   MISC COMPONENTS
   ============================================ */
.profile-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    margin-bottom: 20px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.profile-card:hover {
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

.info-card {
    background: linear-gradient(135deg, var(--light-bg) 0%, #e0f2fe 100%);
    border-left: 4px solid var(--primary-blue);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.search-box { max-width: 400px; }
.action-buttons .btn { margin: 2px; }

.loading { display: none; text-align: center; padding: 20px; }
.loading.active { display: block; }

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active   { background-color: #dcfce7; color: #166534; }
.status-inactive { background-color: #fee2e2; color: #991b1b; }
.status-pending  { background-color: #fef3c7; color: #92400e; }

/* ============================================
   HOMEPAGE — HERO
   ============================================ */
.featured-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 8px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    font-weight: 600;
}

.featured-btn:hover {
    -webkit-transform: translateY(-3px);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* ============================================
   HOMEPAGE — STATISTICS
   ============================================ */
.stat-card {
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.stat-card:hover {
    -webkit-transform: translateY(-8px);
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2) !important;
}

.stat-icon {
    width: 70px;
    height: 70px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    -webkit-transform: scale(1.1) rotate(-5deg);
    transform: scale(1.1) rotate(-5deg);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* ============================================
   HOMEPAGE — GALLERY CAROUSEL
   ============================================ */
#galleryCarousel {
    border-radius: 12px;
    overflow: hidden;
}

.gallery-image {
    -webkit-transition: -webkit-transform 0.6s ease;
    transition: transform 0.6s ease;
    width: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

#galleryCarousel:hover .carousel-item.active .gallery-image {
    -webkit-transform: scale(1.03);
    transform: scale(1.03);
}

.carousel-caption {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 40px 20px 20px !important;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(37, 99, 235, 0.7);
    border-radius: 50%;
    opacity: 0;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
}

#galleryCarousel:hover .carousel-control-prev,
#galleryCarousel:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(37, 99, 235, 0.9);
}

/* ============================================
   HOMEPAGE — TRUST CARDS
   ============================================ */
.trust-card {
    border-radius: 12px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.trust-card:hover {
    -webkit-transform: translateY(-6px);
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.15) !important;
    border-color: rgba(37, 99, 235, 0.3);
}

.trust-card i {
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.trust-card:hover i {
    -webkit-transform: scale(1.2);
    transform: scale(1.2);
}

/* ============================================
   HOMEPAGE — ANNOUNCEMENT CARDS
   ============================================ */
.announcement-card {
    border-radius: 12px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    overflow: hidden;
}

.announcement-card:hover {
    -webkit-transform: translateY(-8px);
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2) !important;
}

.announcement-card img {
    -webkit-transition: -webkit-transform 0.4s ease;
    transition: transform 0.4s ease;
}

.announcement-card:hover img {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
}

/* ============================================
   HOMEPAGE — PROGRAM CARDS
   ============================================ */
.program-card {
    border-radius: 12px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.program-card:hover {
    -webkit-transform: translateX(4px);
    transform: translateX(4px);
    border-color: var(--primary-blue);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.15) !important;
}

.program-card .list-group-item {
    border: none;
    background: transparent;
    padding: 10px 0;
}

/* ============================================
   HOMEPAGE — IMPORTANT INFO CARD
   ============================================ */
.important-info-card {
    border-radius: 12px;
    border-top: 4px solid var(--primary-blue) !important;
}

.important-info-card .list-group-item {
    background: transparent;
    border: none;
    padding: 14px 16px;
    font-weight: 500;
}

.important-info-card .list-group-item i {
    margin-right: 12px;
    font-size: 1.2rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@-webkit-keyframes fadeInUp {
    from { opacity: 0; -webkit-transform: translateY(20px); transform: translateY(20px); }
    to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0); }
}

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

@-webkit-keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.5); }
    50%       { box-shadow: 0 0 15px rgba(37, 99, 235, 0.8); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.5); }
    50%       { box-shadow: 0 0 15px rgba(37, 99, 235, 0.8); }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .navbar, footer, .no-print, .btn, .action-buttons { display: none !important; }
    body  { background: white; }
    .card { box-shadow: none; border: 1px solid #ddd !important; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* --- Tablet (≤991px) --- */
@media (max-width: 991px) {
    body.has-mobile-bottom-nav {
        padding-bottom: calc(var(--mobile-bottom-nav-height, 74px) + 12px);
    }

    .navbar {
        padding: 0.65rem 0;
    }

    .navbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .header-language-dropdown .nav-link {
        border: 1px solid rgba(255, 255, 255, 0.24);
        border-radius: 999px;
        background-color: rgba(255, 255, 255, 0.08);
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1035;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        gap: 0.35rem;
        padding: 0.7rem max(0.75rem, env(safe-area-inset-left)) calc(0.7rem + env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-right));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid rgba(37, 99, 235, 0.12);
        box-shadow: 0 -12px 30px rgba(15, 23, 42, 0.12);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }

    .mobile-bottom-nav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
        height: 58px;
        border-radius: 16px;
        color: var(--primary-blue);
        background: transparent;
        -webkit-transition: background-color 0.2s ease, color 0.2s ease, -webkit-transform 0.2s ease;
        transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
        gap: 0.22rem;
        padding: 0.35rem 0.2rem;
        text-align: center;
    }

    .mobile-bottom-nav__link i {
        font-size: 1.28rem;
        line-height: 1;
    }

    .mobile-bottom-nav__label {
        max-width: 100%;
        font-size: 0.66rem;
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-bottom-nav__link.is-active {
        color: white;
        background: linear-gradient(135deg, var(--primary-blue) 0%, var(--sky-blue) 100%);
        box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
    }

    .mobile-bottom-nav__link.is-danger {
        color: #dc2626;
    }

    .mobile-bottom-nav__link.is-danger.is-active {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    }

    .mobile-bottom-nav__link:active {
        -webkit-transform: translateY(1px);
        transform: translateY(1px);
    }

    /* Nav tabs: allow wrapping on tablets */
    .nav-tabs {
        flex-wrap: wrap !important;
    }
    .nav-tabs .nav-item {
        flex: 0 0 auto;
    }
}

/* --- Mobile landscape / small tablet (≤768px) --- */
@media (max-width: 768px) {
    .navbar-brand { font-size: 1.3rem; }
    .navbar-brand img { max-height: 40px; }

    .header-language-dropdown .nav-link {
        font-size: 0.95rem;
        padding: 0.45rem 0.7rem !important;
    }

    .table-view-toggle-bar {
        margin-bottom: 0.75rem;
    }

    .table-view-toggle {
        width: 100%;
        justify-content: center;
    }

    .table-view-density {
        display: none !important;
    }

    .table-view-toggle__button {
        flex: 1 1 0;
        justify-content: center;
    }

    .table-view-toggle-ready .table,
    .table-view-toggle-ready .table thead,
    .table-view-toggle-ready .table tbody,
    .table-view-toggle-ready .table tr,
    .table-view-toggle-ready .table th,
    .table-view-toggle-ready .table td,
    .table-view-toggle-ready .mobile-cards tbody tr,
    .table-view-toggle-ready .mobile-cards tbody tr td,
    .table-view-toggle-ready .table:not(.table-sm):not(.no-mobile-cards) tbody tr,
    .table-view-toggle-ready .table:not(.table-sm):not(.no-mobile-cards) tbody tr td {
        display: revert !important;
    }

    .table-view-toggle-ready .table thead {
        display: table-header-group !important;
    }

    .table-view-toggle-ready .table tbody {
        display: table-row-group !important;
    }

    .table-view-toggle-ready .table tr {
        display: table-row !important;
    }

    .table-view-toggle-ready .table th,
    .table-view-toggle-ready .table td {
        display: table-cell !important;
    }

    .table-view-toggle-ready .table tbody tr {
        border: 0 !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .table-view-toggle-ready .table tbody tr td {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    .table-view-toggle-ready .table tbody tr td::before {
        display: none !important;
    }

    /* Cards */
    .card { margin-bottom: 15px; }
    .card-header {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
    .card-body { padding: 1rem; }

    /* Card headers: always allow wrapping */
    .card-header.d-flex {
        flex-wrap: wrap !important;
        gap: 0.5rem;
    }

    /* Dashboard cards */
    .dashboard-card { padding: 20px; }
    .dashboard-card i { font-size: 2.5rem; }
    .stat-number { font-size: 2rem; }

    .featured-btn {
        padding: 12px 30px;
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .stat-icon { width: 60px; height: 60px; font-size: 1.5rem; }
    .stat-value { font-size: 2rem; }

    .gallery-image { height: 250px !important; }

    .carousel-control-prev,
    .carousel-control-next { width: 40px; height: 40px; }

    /* Tables: mobile card view for all data tables */
    .mobile-cards thead { display: none; }
    .mobile-cards tbody tr {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }
    .mobile-cards tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.4rem 0.25rem;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem;
    }
    .mobile-cards tbody tr td:last-child { border-bottom: none; }
    .mobile-cards tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        margin-right: 0.75rem;
        flex-shrink: 0;
        font-size: 0.85rem;
        max-width: 40%;
    }
    .mobile-cards tbody tr td[data-label=""]::before,
    .mobile-cards tbody tr td:not([data-label])::before {
        display: none;
    }
    .mobile-cards tbody tr td.mobile-actions {
        flex-wrap: wrap;
        gap: 0.375rem;
        justify-content: flex-start;
        padding-top: 0.5rem;
    }
    .mobile-cards tbody tr td.mobile-actions::before { display: none; }

    /* Action buttons: wrap in table cells */
    td .d-flex.flex-wrap,
    td.action-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.25rem !important;
    }
    .action-buttons .btn {
        font-size: 0.78rem;
        padding: 0.25rem 0.5rem;
        margin: 1px;
    }

    /* Buttons: smaller on mobile */
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    /* forms: tighter padding */
    .form-control, .form-select {
        padding: 0.55rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Search bars in card headers: full width */
    .card-header .input-group {
        max-width: 100% !important;
        width: 100%;
    }

    /* Filter rows: tighter spacing */
    .filter-row .row { row-gap: 0.5rem; }

    /* Nav tabs: scrollable on mobile */
    .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-item { flex: 0 0 auto; white-space: nowrap; }
    .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.85rem;
    }

    /* Modals: full width on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Footer */
    footer .row > div {
        text-align: center;
    }
    footer .d-flex.gap-2 {
        justify-content: center;
    }

    /* Progress bars in wizards */
    .progress { height: 6px !important; }

    /* Badges: slightly smaller */
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.75em;
    }

    /* Table hardcoded widths: override */
    .table th[style*="width"],
    .table th[style*="min-width"] {
        width: auto !important;
        min-width: auto !important;
    }
}

/* --- Phone (≤576px) --- */
@media (max-width: 576px) {
    .container { padding-left: 10px; padding-right: 10px; }

    .mobile-bottom-nav {
        gap: 0.25rem;
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
    }

    .mobile-bottom-nav__link {
        height: 52px;
        border-radius: 14px;
    }

    .mobile-bottom-nav__label {
        font-size: 0.6rem;
    }

    .table-card-item {
        border-radius: 14px;
    }

    .table-card-view {
        grid-template-columns: 1fr !important;
        --table-card-font-size: 0.9rem;
        --table-card-label-size: 0.68rem;
        --table-card-title-size: 0.96rem;
    }

    .table-card-item__header,
    .table-card-item__body,
    .table-card-item__actions {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .table-card-item__actions {
        gap: 0.4rem;
        padding-bottom: 0.9rem;
    }

    .stat-value { font-size: 1.75rem; }
    .featured-btn { padding: 10px 20px; font-size: 0.95rem; }
    .footer-meta { flex-direction: column; text-align: center; }

    /* Cards: less padding */
    .card-body { padding: 0.75rem; }
    .card-header { padding: 0.75rem; }

    /* Page headings */
    h4 { font-size: 1.15rem; }
    h5 { font-size: 1.05rem; }

    /* Tables always mobile-card on phones  */
    .table:not(.table-sm):not(.no-mobile-cards) thead { display: none; }
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr {
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        margin-bottom: 0.65rem;
        padding: 0.65rem;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0.2rem;
        border: none;
        border-bottom: 1px solid #f3f4f6;
        font-size: 0.875rem;
        word-break: break-word;
    }
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td:last-child {
        border-bottom: none;
    }
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4b5563;
        margin-right: 0.5rem;
        flex-shrink: 0;
        font-size: 0.8rem;
        max-width: 45%;
    }
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td[data-label=""]::before,
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td:not([data-label])::before {
        display: none;
    }

    /* Action buttons column: stack */
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td.action-buttons,
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td.mobile-actions {
        flex-wrap: wrap;
        gap: 0.3rem;
        justify-content: flex-start;
        padding-top: 0.5rem;
    }
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td.action-buttons::before,
    .table:not(.table-sm):not(.no-mobile-cards) tbody tr td.mobile-actions::before {
        display: none;
    }

    /* Button text: hide text, show only icons on very small */
    .btn-sm .bi { margin-right: 0; }

    /* Alert text */
    .alert { padding: 0.75rem 1rem; font-size: 0.9rem; }

    /* d-grid gap on mobile */
    .d-sm-flex { gap: 0.5rem; }

    /* Profile wizard step summary table */
    .table-sm tbody tr {
        display: flex;
        flex-wrap: wrap;
    }
    .table-sm tbody tr th {
        flex: 0 0 45%;
        font-size: 0.82rem;
        padding: 0.35rem 0.25rem;
    }
    .table-sm tbody tr td {
        flex: 0 0 55%;
        font-size: 0.82rem;
        padding: 0.35rem 0.25rem;
        word-break: break-word;
    }

    /* Fix btn-group overflow */
    .btn-group {
        flex-wrap: wrap;
    }

    /* Offline search header */
    .offline-search-header {
        flex-direction: column;
        align-items: stretch !important;
    }
    .offline-search-header .input-group {
        max-width: 100% !important;
    }
}

/* ============================================
   ABOUT — AUTO SCROLL GALLERY
   ============================================ */
.about-gallery-wrap .card-header {
    background: linear-gradient(135deg, rgba(240, 249, 255, 1) 0%, rgba(224, 242, 254, 1) 100%);
    border-bottom: 1px solid rgba(37, 99, 235, 0.15) !important;
}

.about-gallery-viewport {
    overflow: hidden;
}

.about-gallery-track {
    display: flex;
    width: 100%;
    transform: translateX(0);
    transition: transform 650ms ease;
}

.about-gallery-page {
    flex: 0 0 100%;
}

.about-gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.about-gallery-item {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.10);
    background: #fff;
}

.about-gallery-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.about-gallery-img.placeholder {
    background: #e5e7eb;
}

@media (max-width: 1200px) {
    .about-gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .about-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .about-gallery-img { height: 125px; }
}

@media (max-width: 576px) {
    .about-gallery-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .about-gallery-img { height: 105px; }
}

/* ============================================
   PUBLIC PAGES — MOBILE RESPONSIVE
   ============================================ */

/* About page title */
.about-page-title { font-size: clamp(1.5rem, 4vw, 2.5rem); }

/* Contact page title */
.contact-page-title { font-size: clamp(1.5rem, 4vw, 2.5rem); }

/* Member photo wrapper */
.member-photo-wrap {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    overflow: hidden;
    border-radius: 50%;
}

@media (max-width: 768px) {
    /* About page */
    .about-page-title { font-size: 1.6rem; }
    .about-content { max-height: none !important; }
    .member-photo-wrap { width: 90px; height: 90px; }

    /* Contact page */
    .contact-page-title { font-size: 1.6rem; }

    /* Gallery page */
    .gallery-item .card-body { padding: 0.4rem; }
    .gallery-item .card-body h6 { font-size: 0.85rem; }

    /* Public page display headings */
    .display-5 { font-size: 1.75rem !important; }
    .lead { font-size: 0.95rem; }
}

@media (max-width: 576px) {
    /* About page */
    .about-page-title { font-size: 1.35rem; }
    .member-photo-wrap { width: 72px; height: 72px; margin-bottom: 8px; }

    /* Contact page */
    .contact-page-title { font-size: 1.35rem; }

    /* Gallery: 2 columns on phones */
    .gallery-item .card-img-container { height: 140px !important; }

    /* Public page display headings */
    .display-5 { font-size: 1.5rem !important; }
    .lead { font-size: 0.88rem; }

    /* Reduce bottom margins on public pages */
    .mb-5 { margin-bottom: 1.5rem !important; }
    .mb-4 { margin-bottom: 1rem !important; }
    .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
