/**
 * Cre8tive Hands — Site Base Template Styles
 * ===========================================
 * Authority stylesheet for site-wide look, feel, and identity.
 * Based on ecards.html. Use this as the single source for:
 * - CSS variables (colors, spacing, shadows)
 * - Body background and typography
 * - Navbar, mobile menu, footer
 * - Base layout utilities
 *
 * All pages that use the site template should:
 * 1. Link to site-base.css first
 * 2. Then link to any page-specific stylesheets
 */

/* ========================================================== */
/* DESIGN TOKENS & VARIABLES                                   */
/* ========================================================== */
:root {
    --primary: #e67e73;
    --secondary: #6ab0b8;
    --accent: #f2c94c;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --text-main: #4a4a4a;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --text-primary: #633b46;
    --text-secondary: #6b7280;
    --nav-height: 80px;
    --container-width: 1152px;
    --theme-plum: #633b46;
    --theme-rose: #8f4e5c;
    --theme-ink: #4f3640;
    --theme-line: rgba(222, 187, 176, 0.45);
    --theme-line-strong: rgba(209, 151, 138, 0.58);
    --theme-surface: rgba(255, 252, 249, 0.96);
    --theme-surface-strong: rgba(253, 241, 233, 0.95);
    --theme-surface-soft: rgba(247, 235, 241, 0.92);
    --theme-shadow: rgba(137, 89, 106, 0.16);

    /* Fluent UI Design Tokens */
    --bg-mica: rgba(255, 249, 246, 0.76);
    --bg-acrylic: rgba(255, 248, 244, 0.72);
    --bg-card: rgba(255, 251, 248, 0.88);
    --border-subtle: rgba(162, 106, 116, 0.12);
    --border-default: rgba(198, 145, 141, 0.24);
    --shadow-card: 0 10px 28px rgba(125, 73, 92, 0.10), 0 4px 12px rgba(125, 73, 92, 0.07);
    --shadow-card-hover: 0 18px 40px rgba(125, 73, 92, 0.14), 0 8px 20px rgba(125, 73, 92, 0.10);
    --shadow-elevated: 0 18px 40px rgba(125, 73, 92, 0.16), 0 6px 16px rgba(125, 73, 92, 0.10);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================== */
/* RESET & BASE ELEMENTS                                       */
/* ========================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background:
        radial-gradient(circle at 12% 12%, rgba(255, 227, 208, 0.8), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(255, 241, 201, 0.7), transparent 24%),
        linear-gradient(145deg, #f5e0e7 0%, #d9e5f4 46%, #f8ecdf 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    overflow-x: hidden;
    width: 100%;
    line-height: 1.5;
    padding-top: var(--nav-height);
    min-height: 100vh;
    transition: background 400ms ease, color 250ms ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.5), transparent 22%),
        radial-gradient(circle at 74% 12%, rgba(255, 244, 214, 0.4), transparent 18%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.65;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ========================================================== */
/* LAYOUT UTILITIES                                            */
/* ========================================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.col-span-full { grid-column: 1 / -1; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.font-hand { font-family: 'Caveat', cursive; }
.font-script { font-family: 'Dancing Script', cursive; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-highlight { color: var(--theme-rose); }
.text-gray-400 { color: #9ca3af; }

/* ========================================================== */
/* NAVBAR                                                      */
/* ========================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background: var(--bg-mica);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
}

.logo-circle {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #d98980, #b96872);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all var(--transition-normal);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 24px rgba(137, 89, 106, 0.24);
    flex-shrink: 0;
}

.nav-logo:hover .logo-circle {
    transform: rotate(12deg) scale(1.05);
    box-shadow: var(--shadow-card-hover);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
    white-space: nowrap;
}

.logo-sub {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    display: block;
    margin-top: 0.15rem;
}

.nav-links {
    display: none;
    gap: 1.25rem;
    font-weight: 600;
    color: #4b5563;
}

.nav-link {
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: calc(100% - 1.5rem);
    height: 2px;
    bottom: 0;
    left: 0.75rem;
    background: linear-gradient(90deg, #d98980, #b96872);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform var(--transition-normal);
    border-radius: 2px;
}

.nav-link.nav-link--active {
    color: var(--theme-rose);
}

.nav-link.nav-link--active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.nav-link:hover {
    color: var(--theme-rose);
    background: rgba(143, 78, 92, 0.08);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.menu-toggle {
    display: block;
    color: #4b5563;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Auth elements (hidden by default when no session) */
.auth-btn {
    background: linear-gradient(135deg, #d98980, #b96872);
    color: var(--white);
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 115, 0.4);
}

.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--bg-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 2px solid rgba(230, 126, 115, 0.4);
    transition: all var(--transition-normal);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================================== */
/* MOBILE MENU                                                 */
/* ========================================================== */
.mobile-menu {
    overflow: hidden;
    background: var(--bg-acrylic);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-smooth);
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    padding: 0 1.5rem;
    margin-top: var(--nav-height);
    position: fixed;
    width: 100%;
    z-index: 40;
    left: 0;
    top: 0;
}

.mobile-menu.open {
    max-height: min(calc(100vh - var(--nav-height)), 600px);
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

.mobile-link {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Caveat', cursive;
    margin-bottom: 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin-left: -0.75rem;
}

.mobile-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--theme-rose);
}

.mobile-link--active {
    color: var(--theme-rose);
    border-left: 3px solid var(--theme-rose);
    padding-left: calc(0.75rem - 3px);
}

/* ========================================================== */
/* SITE FOOTER                                                 */
/* ========================================================== */
.site-footer {
    padding: 2rem 1rem 1.5rem;
    background: linear-gradient(180deg, var(--theme-surface) 0%, var(--theme-surface-soft) 100%);
    border-top: 1px solid var(--theme-line);
    margin-top: 2rem;
    text-align: center;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--theme-plum);
    margin-bottom: 0.25rem;
}

.footer-tagline {
    font-size: 0.8rem;
    color: rgba(79, 54, 64, 0.82);
    margin-bottom: 1rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.footer-nav a {
    color: rgba(79, 54, 64, 0.82);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--theme-rose);
}

.footer-nav span {
    color: #d1d5db;
}

.footer-support-link {
    background: linear-gradient(135deg, #d98980, #b96872);
    color: #fff !important;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    transition: opacity 0.2s, transform 0.15s;
}
.footer-support-link:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff !important;
}

.footer-btm {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: rgba(79, 54, 64, 0.82);
    border-top: 1px solid var(--theme-line);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* ========================================================== */
/* COMMON BUTTON STYLE                                         */
/* ========================================================== */
.btn-cozy {
    background: linear-gradient(135deg, var(--primary) 0%, #d16a60 100%);
    color: var(--white);
    border-radius: var(--radius-xl);
    padding: 0.75rem 2rem;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 4px 16px rgba(230, 126, 115, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-cozy.sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(230, 126, 115, 0.3);
}

.btn-cozy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 115, 0.45);
}

.btn-cozy:active {
    transform: translateY(0);
}

/* ========================================================== */
/* TABLET/DESKTOP STYLES (768px+)                              */
/* ========================================================== */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
        align-items: center;
    }

    .menu-toggle {
        display: none;
    }
}

/* ========================================================== */
/* LOADING SCREEN                                              */
/* ========================================================== */
#cre8tive-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8dce8 0%, #d6e4f0 50%, #f0e4d8 100%);
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#cre8tive-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#cre8tive-loader .loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: loaderFadeIn 0.5s ease;
}

@keyframes loaderFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

#cre8tive-loader .loader-logo {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cre8tive-loader .loader-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 32px rgba(230, 126, 115, 0.4);
    animation: loaderPulse 2s ease-in-out infinite;
}

@keyframes loaderPulse {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-card); }
    50%       { transform: scale(1.05); box-shadow: var(--shadow-card-hover); }
}

#cre8tive-loader .loader-spinner {
    position: absolute;
    inset: -8px;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: loaderSpin 1.2s linear infinite;
}

@keyframes loaderSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

#cre8tive-loader .loader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

#cre8tive-loader .loader-brand {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

#cre8tive-loader .loader-highlight {
    color: var(--primary);
}

#cre8tive-loader .loader-subtitle {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    animation: loaderDots 1.5s ease-in-out infinite;
}

@keyframes loaderDots {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}
