/**
 * Base CSS for www.gamtpedia.com
 * Minimalistic design matching homepage aesthetic
 */

/* ========== RESET & BASE ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* GAMT™ Blue Theme - matches homepage */
    --primary-color: #4A90E2;
    --primary-dark: #357ABD;
    --primary-light: #5BA3F5;

    /* Typography */
    --text-color: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;

    /* Backgrounds */
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-subtle: #f5f7f9;

    /* Borders */
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;

    /* System Font Stack */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    background: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== MODERN NAVBAR ========== */

.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

/* Logo/Brand */
.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 20px;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.navbar-brand .logo:hover {
    opacity: 0.8;
}

.navbar-brand .logo img {
    height: 36px;
    width: auto;
}

.navbar-brand .logo span {
    letter-spacing: -0.5px;
}

/* Menu Container */
.navbar-menu {
    display: flex;
    gap: 48px;
    align-items: center;
}

.navbar-start,
.navbar-end {
    display: flex;
    gap: 32px;
    align-items: center;
}

/* Menu Items */
.navbar-item {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    position: relative;
    padding: 8px 0;
}

/* Pointer cursor for desktop only (devices with hover capability) */
@media (hover: hover) and (pointer: fine) {
    .navbar-item {
        cursor: pointer;
    }
}

.navbar-item:hover {
    color: var(--primary-color);
}

/* Underline effect on hover */
.navbar-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.navbar-item:hover::after {
    width: 100%;
}

/* Mobile Hamburger Menu */
.navbar-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001;
}

.navbar-burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
}

.navbar-burger span:nth-child(1) {
    margin-bottom: 5px;
}

.navbar-burger span:nth-child(3) {
    margin-top: 5px;
}

/* Hamburger Animation - Clean X formation */
.navbar-burger.is-active span:nth-child(1) {
    transform: rotate(45deg);
    position: absolute;
    top: 50%;
    margin-bottom: 0;
}

.navbar-burger.is-active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.navbar-burger.is-active span:nth-child(3) {
    transform: rotate(-45deg);
    position: absolute;
    top: 50%;
    margin-top: 0;
}

/* ========== BUTTONS ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ========== FLASH MESSAGES ========== */

.flash-messages {
    position: fixed;
    top: 88px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
    border: 1px solid;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.alert .close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert .close:hover {
    opacity: 1;
}

/* ========== MODERN MINIMALISTIC FOOTER ========== */

.footer {
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-light);
    padding: 60px 0 32px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.footer-column p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: 32px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Footer Accordion (Mobile Only) */
.footer-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.accordion-icon {
    display: none;
    font-size: 20px;
    font-weight: 400;
    transition: transform 0.3s ease;
}

.footer-accordion-content {
    max-height: none;
    overflow: visible;
    transition: none;
}

/* ========== UTILITY CLASSES ========== */

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.py-1 { padding-top: 8px; padding-bottom: 8px; }
.py-2 { padding-top: 16px; padding-bottom: 16px; }
.py-3 { padding-top: 24px; padding-bottom: 24px; }
.py-4 { padding-top: 32px; padding-bottom: 32px; }

/* ========== RESPONSIVE DESIGN ========== */

@media (max-width: 1024px) {
    .navbar-start {
        gap: 24px;
    }

    .navbar-end {
        gap: 20px;
    }

    .navbar-item {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    /* Mobile Navbar - Only for phones and small tablets */
    .navbar .container {
        height: 64px;
    }

    .navbar-brand .logo {
        font-size: 18px;
    }

    .navbar-brand .logo img {
        height: 24px;
    }

    .navbar-burger {
        display: flex;
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-white);
        padding: 32px 20px;
        box-shadow: none;
        overflow-y: auto;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .navbar-menu.is-active {
        display: flex;
    }

    .navbar-start,
    .navbar-end {
        flex-direction: column;
        width: 100%;
        gap: 0;
        align-items: stretch;
    }

    .navbar-item {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-light);
        font-size: 16px;
    }

    .navbar-item::after {
        display: none;
    }

    .btn-primary {
        margin-top: 16px;
        width: 100%;
        justify-content: center;
    }

    /* Mobile Footer */
    .footer {
        padding: 40px 0 24px;
        margin-top: 60px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 32px;
    }

    /* Enable accordion on mobile */
    .footer-accordion {
        border-bottom: 1px solid var(--border-light);
        padding: 16px 0;
    }

    .footer-accordion-header {
        cursor: pointer;
        user-select: none;
        padding: 4px 0;
        margin-bottom: 0;
    }

    .accordion-icon {
        display: inline-block;
    }

    .footer-accordion.active .accordion-icon {
        transform: rotate(45deg);
    }

    .footer-accordion-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin-top: 0;
    }

    .footer-accordion.active .footer-accordion-content {
        max-height: 500px;
        margin-top: 12px;
    }

    .footer-column h4 {
        font-size: 14px;
        font-weight: 600;
    }

    .footer-column p,
    .footer-column a {
        font-size: 14px;
    }

    .footer-column ul li {
        margin-bottom: 10px;
    }

    .footer-bottom {
        padding-top: 24px;
        font-size: 13px;
    }

    /* Mobile Flash Messages */
    .flash-messages {
        top: 72px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .alert {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .navbar .container {
        height: 56px;
        padding: 0 16px;
    }

    .navbar-brand .logo {
        font-size: 16px;
    }

    .navbar-brand .logo img {
        height: 21px;
    }

    .navbar-item {
        padding: 14px 16px;
        font-size: 15px;
    }

    .footer {
        padding: 32px 0 20px;
    }
}

/* ========== ACCESSIBILITY ========== */

/* Focus states for keyboard navigation */
.navbar-item:focus,
.btn:focus,
.navbar-burger:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .navbar {
        border-bottom-width: 2px;
    }

    .navbar-item:hover {
        text-decoration: underline;
    }
}
