/**
 * Layout System — Premium Edition
 * Header (mega-nav, glass-blur, scroll effects), Footer (animated, gradient)
 * 3-column desktop, mobile tabs — Framer-quality
 * @package SampreShan_Child
 */

/* === BASE RESET (extending parent) === */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text);
    background: var(--bg-soft);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* === TYPOGRAPHY (Global) === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    color: var(--text);
    margin: 0;
}

h1 { font-size: var(--text-4xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-3xl); letter-spacing: var(--tracking-tight); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.display {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

p { margin: 0 0 var(--space-4) 0; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--blue-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--blue-700); }

/* === SITE HEADER (premium glass-morphism) === */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: var(--glass-blur-ultra);
    backdrop-filter: var(--glass-blur-ultra);
    border-bottom: 1px solid var(--glass-border-subtle);
    transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px rgba(10, 26, 61, 0.06), 0 4px 12px rgba(10, 26, 61, 0.04);
    border-bottom-color: var(--border);
}

.site-header__inner {
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.site-header__logo {
    height: 40px;
    width: auto;
    display: block;
    transition: transform var(--transition);
}

.site-header__brand:hover .site-header__logo {
    transform: scale(1.05);
}

.site-header__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    background: linear-gradient(135deg, var(--saffron-700), var(--saffron-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: var(--tracking-tight);
    line-height: 1;
}

/* === HEADER NAV (premium) === */
.site-header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.site-header__nav-link {
    position: relative;
    padding: var(--space-2) var(--space-4);
    color: var(--text-muted);
    font-weight: var(--weight-medium);
    font-size: var(--text-sm);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.site-header__nav-link:hover {
    color: var(--text);
    background: var(--bg-muted);
}

.site-header__nav-link.is-active {
    color: var(--saffron-700);
    background: var(--saffron-50);
}

.site-header__nav-link.is-active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--saffron-500);
    border-radius: var(--radius-full);
}

/* === HEADER ACTIONS === */
.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.site-header__search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.site-header__search-btn:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.site-header__search-btn:focus-visible {
    outline: 2px solid var(--saffron-500);
    outline-offset: 2px;
}

.site-header__notification-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.site-header__notification-btn:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.site-header__notification-btn:focus-visible {
    outline: 2px solid var(--saffron-500);
    outline-offset: 2px;
}

.site-header__notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg);
}

.site-header__user-menu {
    position: relative;
}

.site-header__avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-saffron);
    color: var(--text-invert);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    border: 2px solid transparent;
    overflow: hidden;
}

.site-header__avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 3px var(--saffron-100);
}

.site-header__avatar:focus-visible {
    outline: 2px solid var(--saffron-500);
    outline-offset: 2px;
}

.site-header__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === SEARCH OVERLAY === */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(10, 26, 61, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.search-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.search-overlay__inner {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--elev-6);
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    transition: transform var(--transition);
}

.search-overlay.is-active .search-overlay__inner {
    transform: translateY(0) scale(1);
}

.search-overlay__input-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.search-overlay__input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: var(--text-lg);
    color: var(--text);
    background: transparent;
}

.search-overlay__input::placeholder {
    color: var(--text-soft);
}

.search-overlay__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-overlay__close:hover {
    background: var(--bg-muted);
    color: var(--text);
}

.search-overlay__results {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-2);
}

.search-overlay__result {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.search-overlay__result:hover {
    background: var(--bg-muted);
}

/* === MAIN LAYOUT (3-column) === */
.site-main {
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 320px;
    gap: var(--space-8);
    align-items: start;
}

.site-main__sidebar-left,
.site-main__sidebar-right {
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
    max-height: calc(100vh - var(--header-height) - var(--space-8));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.site-main__sidebar-left::-webkit-scrollbar,
.site-main__sidebar-right::-webkit-scrollbar {
    width: 4px;
}

.site-main__sidebar-left::-webkit-scrollbar-thumb,
.site-main__sidebar-right::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

.site-main__content {
    min-width: 0;
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

/* === SITE FOOTER (premium) === */
.site-footer {
    position: relative;
    background: var(--blue-900);
    color: var(--text-invert);
    margin-top: var(--space-24);
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--saffron-500), var(--gold-400), var(--saffron-500), transparent);
}

.site-footer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 153, 51, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.site-footer__inner {
    position: relative;
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: var(--space-20) var(--space-6) var(--space-8);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-12);
    padding-bottom: var(--space-12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.site-footer__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    color: var(--text-invert);
    margin: 0;
}

.site-footer__tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    max-width: 320px;
}

.site-footer__social {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.site-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    transition: all var(--transition-fast);
}

.site-footer__social-link:hover {
    background: var(--saffron-500);
    border-color: var(--saffron-500);
    color: #fff;
    transform: translateY(-2px);
}

.site-footer__col-title {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--saffron-300);
    margin: 0 0 var(--space-5) 0;
}

.site-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.site-footer__list a {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color var(--transition-fast), padding-left var(--transition-fast);
    display: inline-block;
}

.site-footer__list a:hover {
    color: var(--saffron-300);
    padding-left: 4px;
}

.site-footer__newsletter {
    margin-top: var(--space-6);
}

.site-footer__newsletter-form {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.site-footer__newsletter-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    color: #fff;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    outline: none;
    transition: border-color var(--transition-fast);
}

.site-footer__newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.site-footer__newsletter-input:focus {
    border-color: var(--saffron-500);
}

.site-footer__newsletter-btn {
    padding: var(--space-3) var(--space-5);
    background: var(--gradient-saffron);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}

.site-footer__newsletter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 153, 51, 0.3);
}

.site-footer__bottom {
    position: relative;
    padding-top: var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--text-sm);
}

.site-footer__credit a {
    color: var(--saffron-300);
    text-decoration: none;
    font-weight: var(--weight-medium);
    transition: color var(--transition-fast);
}
.site-footer__credit a:hover { color: var(--saffron-200); }

/* === SCROLL TO TOP BUTTON === */
.scroll-top {
    position: fixed;
    bottom: var(--space-8);
    right: var(--space-8);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--gradient-saffron);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elev-4);
    z-index: var(--z-elevated);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all var(--transition);
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--elev-5);
}

.scroll-top:focus-visible {
    outline: 2px solid var(--saffron-500);
    outline-offset: 2px;
}

/* === SMOOTH FOCUS STYLES (global) === */
:focus-visible {
    outline: 2px solid var(--saffron-500);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* === SMOOTH PAGE LOAD === */
body {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.is-loaded {
    opacity: 1;
}

/* === SELECTION STYLES === */
::selection {
    background: var(--saffron-200);
    color: var(--blue-900);
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === TOAST NOTIFICATIONS === */
.sp-toast {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--blue-900);
    color: #fff;
    border-radius: var(--radius-xl);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    font-size: var(--text-sm);
    font-weight: 500;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: calc(100vw - 2 * var(--space-4));
    white-space: nowrap;
}

.sp-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.sp-toast--success {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

.sp-toast--error {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.sp-toast--info {
    background: var(--blue-900);
}

.sp-toast__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sp-toast__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 0 0 0 var(--space-2);
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.sp-toast__close:hover {
    color: #fff;
}

/* === SPINNER === */
.sp-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

.sp-spinner--sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.sp-spinner--dark {
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: var(--saffron-500);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === FORM INPUT ERROR STATE === */
.sp-form-input.is-error,
.sp-form-select.is-error,
.sp-form-textarea.is-error {
    border-color: var(--red-400, #f87171);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* === SIGNED BUTTON STATE === */
.sp-sign-button.is-signed {
    background: linear-gradient(135deg, #15803d, #16a34a) !important;
    pointer-events: none;
}

.sp-sign-button.is-signed:hover {
    transform: none !important;
    box-shadow: none !important;
}
