/* ============================================
   BASE LAYOUT — navbar, footer, flash toasts
   Extracted from base.html <style> block
   ============================================ */

/* Layout */
html, body { height: 100%; }

body {
    font-family: 'Source Sans Pro', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e3e6f3 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    font-weight: 700;
}

.page-content {
    flex: 1 0 auto;
    width: 100%;
}

.content-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
}

/* ---- Navbar ---- */
.navbar {
    background: var(--gradient-primary);
    padding: 0.8rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand i {
    font-size: 1.6rem;
    color: var(--secondary-color);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.nav-link {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.7rem 1.2rem !important;
    transition: all 0.3s ease;
    position: relative;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--gradient-secondary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.nav-item { margin: 0 0.2rem; }

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
    outline: none;
}

.navbar-toggler-icon {
    background-image: none;
    position: relative;
    border-bottom: 2px solid white;
    transition: all 300ms linear;
}

.navbar-toggler-icon::after,
.navbar-toggler-icon::before {
    width: 24px;
    position: absolute;
    height: 2px;
    background-color: white;
    top: 0;
    left: 0;
    content: '';
    z-index: 2;
    transition: all 300ms linear;
}

.navbar-toggler-icon::after { top: 8px; }

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
    transform: rotate(45deg);
    background-color: white;
    height: 2px;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon { border-color: transparent; }

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
    transform: translateY(8px) rotate(-45deg);
    background-color: white;
    height: 2px;
}

.nav-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.user-profile i { color: var(--secondary-color); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.user-profile span { color: white; font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* ---- Buttons (base overrides) ---- */
.btn-custom {
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.btn-secondary {
    background: var(--gradient-secondary);
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary-color) 100%);
}

/* ---- Cards (base overrides) ---- */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ---- Alerts (base overrides — gradient style) ---- */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #2c3e50;
}

.alert-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

/* ---- Footer ---- */
.site-footer {
    margin-top: auto;
    padding: 0;
    background: transparent;
    color: white;
    width: 100%;
}

.site-footer .footer-wrap {
    background: var(--gradient-primary);
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
    width: 100%;
}

.site-footer .footer-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
}

.site-footer .container,
.site-footer .row,
.site-footer .col-md-4,
.site-footer .text-center,
.site-footer hr { background: transparent !important; }

.footer-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.footer-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.3rem 0;
}

.footer-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

.site-footer p,
.site-footer li,
.site-footer ul { color: rgba(255, 255, 255, 0.85); }

.site-footer .footer-bottom { background: transparent; }
.site-footer .footer-bottom hr { border-color: rgba(255, 255, 255, 0.25); }

.footer-legal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.footer-legal-link {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 0.94rem;
    transition: color 0.2s ease;
}

.footer-legal-link:hover { color: var(--secondary-color); }
.footer-legal-separator { color: rgba(255,255,255,0.38); }

.footer-address {
    font-style: normal;
    line-height: 1.7;
}

.footer-address-line { display: block; }

/* ---- Form base overrides ---- */
.form-control {
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 0.8rem 1rem;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.9);
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(57, 73, 171, 0.15);
    background: white;
}

/* ---- Flash toasts ---- */
.flash-toast-stack {
    position: fixed;
    top: 4.5rem;
    right: 1.25rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(26rem, calc(100vw - 2.5rem));
    pointer-events: none;
}

.flash-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.14);
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.45;
    pointer-events: auto;
    animation: flashSlideIn 0.22s ease;
}

@keyframes flashSlideIn {
    from { opacity: 0; transform: translateX(1.5rem); }
    to   { opacity: 1; transform: translateX(0); }
}

.flash-toast.flash-success { background: linear-gradient(135deg, #166534 0%, #15803d 100%); color: #f0fdf4; }
.flash-toast.flash-danger  { background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%); color: #fff1f2; }
.flash-toast.flash-warning { background: linear-gradient(135deg, #92400e 0%, #b45309 100%); color: #fffbeb; }
.flash-toast.flash-info    { background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%); color: #eff6ff; }

.flash-toast-icon {
    flex-shrink: 0;
    font-size: 1rem;
    margin-top: 0.1rem;
}

.flash-toast-body { flex: 1; }

.flash-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.7;
    font-size: 0.85rem;
    color: inherit;
    line-height: 1;
    margin-top: 0.15rem;
}

.flash-toast-close:hover { opacity: 1; }

@media (max-width: 480px) {
    .flash-toast-stack {
        top: auto;
        bottom: 1rem;
        right: 0.75rem;
        left: 0.75rem;
        max-width: 100%;
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }
