/* ===== CSS Variables ===== */
:root {
    /* Primary - бордовый акцент с сайта chayin.ru */
    --primary: #9d1c41;
    --primary-light: #c72952;
    --primary-dark: #7a1533;

    /* Secondary - зеленые оттенки чая с фона */
    --secondary: #4A7C59;
    --secondary-light: #6B8E23;

    /* Accent - теплые оттенки неба */
    --accent: #E8B4A0;
    --accent-light: #F4D1AE;

    /* Neutral - для стеклянных элементов */
    --glass-white: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --backdrop-blur: 20px;

    /* Dark elements */
    --dark-bg: #222222;
    --dark-hover: #333333;

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.65);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Shadows */
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ===== Background Image ===== */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.5) 100%);
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.tagline {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-secondary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== Navigation Grid ===== */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    flex: 1;
}

/* ===== Navigation Cards (Glassmorphism) ===== */
.nav-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    min-height: 180px;

    /* Glassmorphism Effect */
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));

    box-shadow: var(--shadow-sm);

    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;

    transition: all 200ms ease-in-out;
}

.nav-card:hover,
.nav-card:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.nav-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Featured Card (AI Selection) */
.nav-card-featured {
    background: linear-gradient(135deg,
            rgba(157, 28, 65, 0.3) 0%,
            rgba(255, 255, 255, 0.15) 100%);
    border: 1px solid rgba(157, 28, 65, 0.4);
}

.nav-card-featured:hover,
.nav-card-featured:focus {
    background: linear-gradient(135deg,
            rgba(157, 28, 65, 0.4) 0%,
            rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(157, 28, 65, 0.5);
}

/* ===== Card Content ===== */
.nav-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    transition: transform 200ms ease-in-out;
}

.nav-card:hover .nav-card-icon {
    transform: scale(1.1);
}

.nav-card-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.nav-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-card-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-top: auto;
}

.footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 200ms ease-in-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.footer-link:hover {
    color: var(--text-primary);
}

/* ===== Page Template Styles ===== */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-content {
    background: var(--glass-white);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    width: 100%;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.page-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.75;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--primary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 200ms ease-in-out;
    box-shadow: var(--shadow-sm);
}

.back-button:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.back-button svg {
    width: 20px;
    height: 20px;
}

/* ===== Action Button ===== */
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    margin-top: var(--spacing-lg);

    /* Glassmorphism Effect */
    background: linear-gradient(135deg,
            rgba(157, 28, 65, 0.4) 0%,
            rgba(157, 28, 65, 0.3) 100%);
    border: 1px solid rgba(157, 28, 65, 0.5);
    border-radius: var(--radius-md);
    backdrop-filter: blur(var(--backdrop-blur));
    -webkit-backdrop-filter: blur(var(--backdrop-blur));

    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;

    box-shadow: var(--shadow-sm);
    transition: all 200ms ease-in-out;
}

.action-button:hover,
.action-button:focus {
    background: linear-gradient(135deg,
            rgba(157, 28, 65, 0.5) 0%,
            rgba(157, 28, 65, 0.4) 100%);
    border-color: rgba(157, 28, 65, 0.6);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.action-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .logo {
        font-size: 2.5rem;
    }

    .nav-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .nav-card {
        min-height: 140px;
        padding: var(--spacing-md);
    }

    .nav-card-icon {
        width: 40px;
        height: 40px;
    }

    .nav-card-title {
        font-size: 1.125rem;
    }

    .page-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 375px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: var(--spacing-md);
    }

    .logo {
        font-size: 2rem;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
.nav-card:focus-visible,
.back-button:focus-visible,
.footer-link:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 4px;
}