/* Custom CSS for Leierett.no — Nordic Warmth Theme */

/* CSS Custom Properties */
:root {
    --color-primary: #2D6A4F;
    --color-primary-light: #52B788;
    --color-primary-lighter: #D8F3DC;
    --color-primary-dark: #1B4332;
    --color-accent: #E07A5F;
    --color-accent-light: #F2CC8F;
    --color-background: #FFFBF5;
    --color-text: #264653;
    --color-text-muted: #5C6B63;
    --color-border: #E8E0D8;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Ensure smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom focus styles */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Heading font */
h1, h2, h3, h4, h5, h6 {
    font-family: "Bricolage Grotesque", system-ui, sans-serif;
}

/* ========== Grain Texture Overlay ========== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ========== Animated Blob Shapes ========== */
.blob {
    position: absolute;
    border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
    filter: blur(40px);
    opacity: 0.15;
    pointer-events: none;
    animation: blob-morph 8s ease-in-out infinite;
}

.blob-primary {
    background: #52B788;
}

.blob-accent {
    background: #E07A5F;
}

@keyframes blob-morph {
    0%, 100% {
        border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
        transform: translate(0, 0) scale(1);
    }
    25% {
        border-radius: 50% 50% 30% 70% / 50% 60% 40% 50%;
        transform: translate(20px, -15px) scale(1.05);
    }
    50% {
        border-radius: 30% 70% 50% 50% / 40% 50% 50% 60%;
        transform: translate(-10px, 10px) scale(0.95);
    }
    75% {
        border-radius: 60% 40% 40% 60% / 50% 40% 60% 50%;
        transform: translate(15px, 5px) scale(1.02);
    }
}

/* ========== Gradient Buttons ========== */
.btn-gradient-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #2D6A4F 0%, #52B788 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.15s ease;
    box-shadow: 0 4px 14px -3px rgba(45, 106, 79, 0.4);
}

.btn-gradient-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #52B788 0%, #2D6A4F 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.btn-gradient-primary:hover {
    box-shadow: 0 8px 24px -4px rgba(45, 106, 79, 0.5);
}

.btn-gradient-primary:hover::before {
    opacity: 1;
}

.btn-gradient-primary > * {
    position: relative;
    z-index: 1;
}

.btn-gradient-accent {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #E07A5F 0%, #F2CC8F 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.15s ease;
    box-shadow: 0 4px 14px -3px rgba(224, 122, 95, 0.4);
}

.btn-gradient-accent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #F2CC8F 0%, #E07A5F 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.btn-gradient-accent:hover {
    box-shadow: 0 8px 24px -4px rgba(224, 122, 95, 0.5);
}

.btn-gradient-accent:hover::before {
    opacity: 1;
}

.btn-gradient-accent > * {
    position: relative;
    z-index: 1;
}

/* ========== Glassmorphism Nav ========== */
.nav-glass {
    background: linear-gradient(135deg, rgba(255, 251, 245, 0.88) 0%, rgba(255, 248, 239, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    saturate: 1.8;
    border-bottom: 1px solid rgba(232, 224, 216, 0.6);
}

/* ========== Card Accent Borders ========== */
.card-accent-left {
    border-left: 3px solid transparent;
    border-image: linear-gradient(180deg, #2D6A4F 0%, #52B788 100%) 1;
}

.card-accent-top {
    position: relative;
    overflow: hidden;
}

.card-accent-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2D6A4F 0%, #52B788 100%);
}

/* ========== Card Entrance Animation ========== */
.card-entrance {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    animation: card-enter 0.5s ease-out forwards;
}

@keyframes card-enter {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== Press Micro-Interaction ========== */
.press-scale {
    transition: transform 0.1s ease;
}

.press-scale:active {
    transform: scale(0.97);
}

/* ========== Warm card base style ========== */
.warm-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px 0 rgba(38, 70, 83, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.warm-card:hover {
    box-shadow: 0 8px 16px -4px rgba(38, 70, 83, 0.12);
}

/* Card hover lift */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(38, 70, 83, 0.15);
}

/* Stagger-in animation for grids */
.stagger-in > * {
    opacity: 0;
    animation: stagger-in 0.5s ease-out forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes stagger-in {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ========== Shield Avatar ========== */
.shield-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2D6A4F 0%, #52B788 100%);
    border-radius: 12px;
    flex-shrink: 0;
}

.shield-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* ========== Drawer Styles ========== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(38, 70, 83, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.history-drawer {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 4px 0 24px -4px rgba(38, 70, 83, 0.15);
}

.history-drawer.open {
    transform: translateX(0);
}

/* Print styles */
@media print {
    nav, footer, .no-print {
        display: none !important;
    }

    .chat-container {
        height: auto !important;
    }

    body {
        background: white !important;
    }

    body::before {
        display: none;
    }
}
