/* ============================================
   LOOT SURVIVOR COMMUNITY - STYLES
   Dark fantasy theme with green accents
   ============================================ */

/* ============================================
   CSS VARIABLES & ROOT
   ============================================ */
:root {
    /* Loot Survivor Color Palette - Matching Game UI */
    --color-primary: #d4af37;
    --color-primary-bright: #f0d98d;
    --color-primary-glow: rgba(212, 175, 55, 0.4);
    --color-bg-dark: #0a0e0a;
    --color-bg-darker: #050805;
    --color-bg-card: #0d1f0d;
    --color-bg-card-darker: #081308;
    --color-text-primary: #e8dfc0;
    --color-text-secondary: #8a9a7a;
    --color-border: #2d4a2d;
    --color-border-bright: #3d6a3d;
    --color-border-inner: #1a2a1a;
    --color-shadow: rgba(0, 0, 0, 0.8);
    
    /* Spacing - Very compact */
    --spacing-xs: 0.3rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    
    /* Typography */
    --font-title: 'Cinzel', serif;
    --font-body: 'Inconsolata', monospace;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Styles */
    --border-width: 2px;
    --border-radius: 4px;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-darker);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
}

/* Very light overlay for readability */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(5, 8, 5, 0.3) 0%,
        rgba(10, 14, 10, 0.4) 50%,
        rgba(5, 8, 5, 0.45) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    padding: calc(var(--spacing-lg) + var(--spacing-lg)) 0 var(--spacing-md) 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

.title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: 0.3rem;
}

.title-main {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 700;
    color: #e8d4a0;
    text-shadow: 
        0 0 8px rgba(232, 212, 160, 0.4),
        0 0 15px rgba(232, 212, 160, 0.3),
        2px 2px 4px var(--color-shadow);
    letter-spacing: 0.08em;
    animation: glow 2s ease-in-out infinite alternate;
}

.title-sub {
    font-family: var(--font-title);
    font-size: clamp(0.9rem, 2vw, 1.25rem);
    font-weight: 400;
    color: var(--color-text-secondary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.subtitle {
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: var(--color-text-secondary);
    font-weight: 400;
    letter-spacing: 0.05em;
}

@keyframes glow {
    from {
        text-shadow: 
            0 0 8px rgba(232, 212, 160, 0.4),
            0 0 15px rgba(232, 212, 160, 0.3),
            2px 2px 4px var(--color-shadow);
    }
    to {
        text-shadow: 
            0 0 12px rgba(232, 212, 160, 0.5),
            0 0 20px rgba(232, 212, 160, 0.4),
            2px 2px 4px var(--color-shadow);
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main {
    padding: 0 0 var(--spacing-lg) 0;
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: calc(var(--spacing-xl) + var(--spacing-lg));
}

/* ============================================
   PROJECTS GRID
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   PROJECT CARD - Game UI Style
   ============================================ */
.project-card {
    position: relative;
    background: var(--color-bg-card-darker);
    border: 3px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--transition-medium);
    box-shadow: 
        0 2px 4px var(--color-shadow),
        inset 0 0 0 1px var(--color-border-inner),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        transparent 0%,
        var(--color-primary-glow) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity var(--transition-medium);
    pointer-events: none;
    z-index: 1;
}

.project-card:hover {
    border-color: var(--color-border-bright);
    transform: translateY(-4px);
    box-shadow: 
        0 4px 12px var(--color-shadow),
        0 0 20px rgba(212, 175, 55, 0.2),
        inset 0 0 0 1px var(--color-border-bright),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.project-card:hover::before {
    opacity: 0.05;
}

.card-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ============================================
   CARD IMAGE
   ============================================ */
.card-image {
    position: relative;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--color-bg-darker);
    border-bottom: 2px solid var(--color-border);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
    filter: brightness(0.75) contrast(1.15) saturate(0.9);
}

.project-card:hover .card-image img {
    transform: scale(1.05);
    filter: brightness(0.85) contrast(1.2) saturate(1);
}

.card-overlay {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    z-index: 3;
}

.card-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: var(--color-bg-card-darker);
    border: 2px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-primary);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 
        0 2px 6px var(--color-shadow),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* ============================================
   CARD CONTENT
   ============================================ */
.card-content {
    padding: 0.6rem 0.7rem 0.7rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.card-title {
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.15rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-description {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-text-secondary);
    margin-bottom: 0.4rem;
    flex-grow: 1;
}

/* ============================================
   EXPLORE BUTTON (Exact Game Style)
   ============================================ */
.btn-explore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    background: linear-gradient(180deg, #1a2a1a 0%, #0d1a0d 100%);
    border: 3px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-primary);
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 6px var(--color-shadow),
        inset 0 0 0 1px var(--color-border-inner),
        inset 0 0 15px rgba(0, 0, 0, 0.6);
    width: 100%;
}

.btn-explore::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(212, 175, 55, 0.15),
        transparent
    );
    transition: left var(--transition-medium);
}

.btn-explore:hover::before {
    left: 100%;
}

.btn-explore:hover {
    background: linear-gradient(180deg, #2a3a2a 0%, #1a2a1a 100%);
    border-color: var(--color-border-bright);
    color: var(--color-primary-bright);
    box-shadow: 
        0 4px 10px var(--color-shadow),
        0 0 15px rgba(212, 175, 55, 0.3),
        inset 0 0 0 1px var(--color-border-bright),
        inset 0 0 20px rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.btn-explore:active {
    transform: translateY(0);
    box-shadow: 
        0 1px 3px var(--color-shadow),
        inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.btn-text {
    position: relative;
    z-index: 2;
}

/* ============================================
   FOOTER - Fixed at Bottom with Skull Separators
   ============================================ */
.footer {
    padding: 0.5rem 0;
    text-align: center;
    border-top: 2px solid var(--color-border);
    position: relative;
    z-index: 10;
    background: rgba(10, 14, 10, 0.7);
    backdrop-filter: blur(5px);
    margin-top: auto;
}

.footer-text {
    color: var(--color-primary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    line-height: 1.2;
}

.footer-text a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
    white-space: nowrap;
}

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

.separator-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    filter: brightness(1.2);
    transition: all var(--transition-fast);
}

.separator-icon:hover {
    opacity: 1;
    filter: brightness(1.5);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (min-width: 1500px) {
    .projects-grid {
        grid-template-columns: repeat(5, 1fr);
        max-width: 1500px;
    }
}

@media (min-width: 1100px) and (max-width: 1499px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-xl: 1.5rem;
        --spacing-lg: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .header {
        padding: var(--spacing-md) 0 var(--spacing-sm) 0;
    }
    
    .card-image {
        height: 180px;
    }
    
    .footer-text {
        font-size: 0.65rem;
        gap: 0.35rem;
    }
    
    .separator-icon {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .card-content {
        padding: var(--spacing-sm);
    }
    
    .card-image {
        height: 150px;
    }
    
    .footer-text {
        font-size: 0.6rem;
        gap: 0.3rem;
    }
    
    .separator-icon {
        width: 12px;
        height: 12px;
    }
}

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

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================
   LOADING STATE
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.card-image img[src*="placeholder"] {
    animation: shimmer 2s infinite;
    background: linear-gradient(
        90deg,
        var(--color-bg-card) 0%,
        var(--color-bg-darker) 50%,
        var(--color-bg-card) 100%
    );
    background-size: 1000px 100%;
}

