/* Hytale Garage - Hytale-Inspired Theme */

/* ============================================
   CSS Custom Properties (Hytale Color Palette)
   ============================================ */
:root {
    /* Primary colors - Hytale inspired */
    --hytale-orange: #f5a623;
    --hytale-orange-light: #ffc107;
    --hytale-orange-dark: #e09000;

    --hytale-teal: #00d4aa;
    --hytale-teal-light: #26edcb;
    --hytale-teal-dark: #00b894;

    --hytale-purple: #8b5cf6;
    --hytale-purple-light: #a78bfa;
    --hytale-purple-dark: #7c3aed;

    /* Background colors - Deep blues/purples */
    --bg-darkest: #0a0e1a;
    --bg-dark: #0f1729;
    --bg-medium: #1a2238;
    --bg-light: #242d44;
    --bg-lighter: #2d3a56;

    /* Text colors */
    --text-primary: #e8eaf0;
    --text-secondary: #9ca3b8;
    --text-muted: #6b7394;

    /* Border colors */
    --border-dark: #1e2740;
    --border-medium: #2a3654;
    --border-light: #3d4a6a;

    /* Accent gradients */
    --gradient-orange: linear-gradient(135deg, #f5a623 0%, #ff6b35 100%);
    --gradient-teal: linear-gradient(135deg, #00d4aa 0%, #00b4d8 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    --gradient-card: linear-gradient(180deg, rgba(26, 34, 56, 0.8) 0%, rgba(15, 23, 41, 0.9) 100%);
}

/* ============================================
   Base Styles
   ============================================ */
html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-darkest);
    background-image:
        radial-gradient(ellipse at top, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(0, 212, 170, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Subtle texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   HTMX Loading Indicator
   ============================================ */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* ============================================
   Typography
   ============================================ */
.prose {
    line-height: 1.8;
    color: var(--text-primary);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.prose h1 {
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prose h2 {
    color: var(--hytale-teal);
    border-bottom: 2px solid var(--border-medium);
    padding-bottom: 0.5rem;
}

.prose p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.prose a {
    color: var(--hytale-teal);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.prose a:hover {
    color: var(--hytale-teal-light);
    border-bottom-color: var(--hytale-teal);
}

.prose strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   Code Blocks - Hytale styled
   ============================================ */
.prose code {
    background: var(--bg-light);
    color: var(--hytale-orange-light);
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-medium);
}

.prose pre {
    background: var(--bg-dark);
    border: 2px solid var(--border-medium);
    border-radius: 0.75rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.prose pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-teal);
    border-radius: 0.75rem 0.75rem 0 0;
}

.prose pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: var(--text-primary);
}

pre code.hljs {
    background: transparent;
    padding: 0;
}

/* ============================================
   Lists
   ============================================ */
.prose ul,
.prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.prose li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.prose li::marker {
    color: var(--hytale-teal);
}

/* ============================================
   Tables - Game UI styled
   ============================================ */
.prose table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 2px solid var(--border-medium);
}

.prose th {
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-medium) 100%);
    color: var(--hytale-teal);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--hytale-teal-dark);
}

.prose td {
    background: var(--bg-dark);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-secondary);
}

.prose tr:last-child td {
    border-bottom: none;
}

.prose tr:hover td {
    background: var(--bg-medium);
}

/* ============================================
   Cards & Panels - Game UI styled
   ============================================ */
.hytale-card {
    background: var(--gradient-card);
    border: 2px solid var(--border-medium);
    border-radius: 1rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.2),
        0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.hytale-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-orange);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hytale-card:hover {
    border-color: var(--hytale-orange);
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.3),
        0 4px 6px -2px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(245, 166, 35, 0.1);
}

.hytale-card:hover::before {
    opacity: 1;
}

/* ============================================
   Buttons - Chunky game-like buttons
   ============================================ */
.hytale-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.hytale-btn-primary {
    background: var(--gradient-orange);
    color: var(--bg-darkest);
    border-color: var(--hytale-orange-dark);
    box-shadow:
        0 4px 0 var(--hytale-orange-dark),
        0 6px 10px rgba(0, 0, 0, 0.3);
}

.hytale-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 0 var(--hytale-orange-dark),
        0 8px 15px rgba(0, 0, 0, 0.3);
}

.hytale-btn-primary:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 var(--hytale-orange-dark),
        0 3px 5px rgba(0, 0, 0, 0.3);
}

.hytale-btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--border-light);
    box-shadow:
        0 4px 0 var(--bg-darkest),
        0 6px 10px rgba(0, 0, 0, 0.3);
}

.hytale-btn-secondary:hover {
    background: var(--bg-lighter);
    border-color: var(--hytale-teal);
    color: var(--hytale-teal);
}

/* ============================================
   Navigation - Game menu styled
   ============================================ */
.hytale-nav {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    border-bottom: 2px solid var(--border-medium);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hytale-nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
}

.hytale-nav-link:hover {
    color: var(--hytale-teal);
    background: rgba(0, 212, 170, 0.1);
}

.hytale-nav-link.active {
    color: var(--bg-darkest);
    background: var(--gradient-orange);
    font-weight: 600;
}

/* ============================================
   Badges & Tags - Item rarity styled
   ============================================ */
.hytale-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.375rem;
    border: 1px solid;
}

.hytale-badge-orange {
    background: rgba(245, 166, 35, 0.15);
    color: var(--hytale-orange);
    border-color: rgba(245, 166, 35, 0.3);
}

.hytale-badge-teal {
    background: rgba(0, 212, 170, 0.15);
    color: var(--hytale-teal);
    border-color: rgba(0, 212, 170, 0.3);
}

.hytale-badge-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--hytale-purple);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ============================================
   Sidebar - Inventory panel styled
   ============================================ */
.hytale-sidebar {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    border: 2px solid var(--border-medium);
    border-radius: 1rem;
    overflow: hidden;
}

.hytale-sidebar-header {
    background: var(--bg-light);
    padding: 1rem;
    border-bottom: 2px solid var(--border-medium);
    font-weight: 600;
    color: var(--hytale-teal);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.hytale-sidebar-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.hytale-sidebar-item:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    border-left-color: var(--hytale-teal);
}

.hytale-sidebar-item.active {
    background: rgba(0, 212, 170, 0.1);
    color: var(--hytale-teal);
    border-left-color: var(--hytale-teal);
    font-weight: 500;
}

/* ============================================
   Warning/Info Boxes - Quest notification styled
   ============================================ */
.hytale-alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 2px solid;
    position: relative;
    margin: 1.5rem 0;
}

.hytale-alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0.75rem 0 0 0.75rem;
}

.hytale-alert-warning {
    background: rgba(245, 166, 35, 0.1);
    border-color: rgba(245, 166, 35, 0.3);
}

.hytale-alert-warning::before {
    background: var(--hytale-orange);
}

.hytale-alert-info {
    background: rgba(0, 212, 170, 0.1);
    border-color: rgba(0, 212, 170, 0.3);
}

.hytale-alert-info::before {
    background: var(--hytale-teal);
}

/* ============================================
   Logo & Branding
   ============================================ */
.hytale-logo {
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(245, 166, 35, 0.3);
}

/* Stylized Text Logo */
.hytale-logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.25rem 0;
}

.hytale-logo-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.hytale-logo-link:hover .hytale-logo-icon {
    transform: rotate(-12deg) scale(1.1);
}

.hytale-logo-text {
    display: flex;
    align-items: center;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    gap: 0.125rem;
}

.hytale-logo-bracket {
    color: var(--hytale-teal);
    font-weight: 400;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.hytale-logo-link:hover .hytale-logo-bracket {
    opacity: 1;
    color: var(--hytale-teal-light);
}

.hytale-logo-word-hytale {
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(245, 166, 35, 0.3));
}

.hytale-logo-separator {
    color: var(--text-muted);
    font-weight: 300;
    margin: 0 0.125rem;
    opacity: 0.5;
}

.hytale-logo-word-garage {
    background: var(--gradient-teal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(0, 212, 170, 0.3));
}

.hytale-logo-link:hover .hytale-logo-word-hytale {
    filter: drop-shadow(0 2px 8px rgba(245, 166, 35, 0.5));
}

.hytale-logo-link:hover .hytale-logo-word-garage {
    filter: drop-shadow(0 2px 8px rgba(0, 212, 170, 0.5));
}

/* ============================================
   Footer - Game UI styled
   ============================================ */
.hytale-footer {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darkest) 100%);
    border-top: 2px solid var(--border-medium);
    position: relative;
}

.hytale-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hytale-teal), transparent);
}

/* ============================================
   Scrollbar - Themed
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hytale-teal-dark);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background-color: var(--hytale-teal);
    color: var(--bg-darkest);
}

/* ============================================
   Focus States
   ============================================ */
*:focus {
    outline: 2px solid var(--hytale-teal);
    outline-offset: 2px;
}

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

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 212, 170, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 212, 170, 0.5);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-gradient-orange {
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-teal {
    background: var(--gradient-teal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-glow-orange {
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.3);
}

.border-glow-teal {
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.3);
}
