/* ==================== VARIABLES ==================== */
:root {
    --charcoal: #1a1a2e;
    --charcoal-light: #25254a;
    --amber: #e67e22;
    --amber-bright: #f39c12;
    --steel: #7f8c8d;
    --steel-light: #95a5a6;
    --white: #ecf0f1;
    --green: #2ecc71;
    --yellow: #f1c40f;
    --red: #e74c3c;
    --blue: #3498db;
    
    --font-mono: 'Roboto Mono', monospace;
    --font-sans: 'Inter', sans-serif;
    
    --glow-amber: 0 0 10px rgba(230, 126, 34, 0.5);
    --glow-green: 0 0 8px rgba(46, 204, 113, 0.6);
}

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

body {
    font-family: var(--font-sans);
    background: var(--charcoal);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ==================== GRID BACKGROUND ==================== */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(127, 140, 141, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(127, 140, 141, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ==================== HEADER ==================== */
.header {
    padding: 60px 0 40px;
    border-bottom: 2px solid var(--steel);
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.95) 0%, rgba(26, 26, 46, 0.7) 100%);
    backdrop-filter: blur(10px);
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--amber), transparent);
    animation: pulse-line 3s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

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

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.gear-icon {
    width: 50px;
    height: 50px;
    color: var(--amber);
    animation: rotate-gear 20s linear infinite;
    filter: drop-shadow(var(--glow-amber));
}

@keyframes rotate-gear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.site-title {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--white);
    text-shadow: 
        0 0 20px rgba(230, 126, 34, 0.5),
        0 0 40px rgba(230, 126, 34, 0.2);
}

.site-tagline {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--steel-light);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==================== STATS BAR ==================== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
    padding: 30px;
    background: rgba(37, 37, 74, 0.5);
    border: 2px solid var(--steel);
    border-radius: 4px;
    position: relative;
}

.stats-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--amber);
    box-shadow: var(--glow-amber);
}

.stat-item {
    text-align: center;
    padding: 10px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--amber-bright);
    text-shadow: var(--glow-amber);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--steel-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    justify-content: center;
}

.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 12px 24px;
    background: rgba(37, 37, 74, 0.7);
    border: 2px solid var(--steel);
    color: var(--steel-light);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(230, 126, 34, 0.3), transparent);
    transition: left 0.5s ease;
}

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

.filter-btn:hover {
    border-color: var(--amber);
    color: var(--amber);
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.3);
}

.filter-btn.active {
    background: var(--amber);
    border-color: var(--amber-bright);
    color: var(--charcoal);
    box-shadow: var(--glow-amber);
}

/* ==================== RACK CONTAINER ==================== */
.rack-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

/* ==================== APP CARD (RACK UNIT) ==================== */
.app-card {
    background: linear-gradient(135deg, rgba(37, 37, 74, 0.9) 0%, rgba(26, 26, 46, 0.9) 100%);
    border: 2px solid var(--steel);
    border-left: 4px solid var(--steel);
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 12px;
    left: -2px;
    width: 4px;
    height: calc(100% - 24px);
    background: repeating-linear-gradient(
        0deg,
        var(--steel) 0px,
        var(--steel) 3px,
        transparent 3px,
        transparent 8px
    );
}

.app-card:hover {
    border-color: var(--amber);
    border-left-color: var(--amber);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(230, 126, 34, 0.2);
    transform: translateY(-4px);
}

.app-card:hover .status-led {
    box-shadow: 0 0 15px currentColor;
}

.app-card.hidden {
    display: none;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.app-title {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.app-tagline {
    font-size: 0.85rem;
    color: var(--steel-light);
    font-style: italic;
}

/* Status Indicators */
.indicators {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    animation: pulse-led 2s ease-in-out infinite;
}

@keyframes pulse-led {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-led.live {
    background: var(--green);
    box-shadow: var(--glow-green);
}

.status-led.beta {
    background: var(--yellow);
    box-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
}

.status-led.dev {
    background: var(--red);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
}

.access-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 2px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.access-badge.public {
    background: rgba(46, 204, 113, 0.2);
    color: var(--green);
    border: 1px solid var(--green);
}

.access-badge.private {
    background: rgba(52, 152, 219, 0.2);
    color: var(--blue);
    border: 1px solid var(--blue);
}

/* Screenshot */
.app-screenshot {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(127, 140, 141, 0.3);
    position: relative;
}

.app-screenshot img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0.85) saturate(0.9);
}

.app-card:hover .app-screenshot img {
    transform: scale(1.02);
    filter: brightness(1) saturate(1);
}

.app-screenshot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--charcoal-light));
    pointer-events: none;
}

/* Card Content */
.app-description {
    color: var(--steel-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(127, 140, 141, 0.2);
    border: 1px solid var(--steel);
    color: var(--steel-light);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.app-card:hover .tech-tag {
    border-color: var(--amber);
    color: var(--amber-bright);
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(127, 140, 141, 0.3);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--steel);
}

.host-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.host-icon {
    width: 14px;
    height: 14px;
    fill: var(--steel);
}

.port-info {
    color: var(--amber);
}

/* ==================== FOOTER ==================== */
.footer {
    padding: 40px 0;
    border-top: 2px solid var(--steel);
    margin-top: 60px;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--steel-light);
}

.footer-timestamp {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--steel);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 2rem;
        letter-spacing: 4px;
    }
    
    .gear-icon {
        width: 35px;
        height: 35px;
    }
    
    .rack-container {
        grid-template-columns: 1fr;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .filter-bar {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
}

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

.app-card {
    animation: fadeIn 0.5s ease forwards;
}

.app-card:nth-child(1) { animation-delay: 0.05s; }
.app-card:nth-child(2) { animation-delay: 0.1s; }
.app-card:nth-child(3) { animation-delay: 0.15s; }
.app-card:nth-child(4) { animation-delay: 0.2s; }
.app-card:nth-child(5) { animation-delay: 0.25s; }
.app-card:nth-child(6) { animation-delay: 0.3s; }
