/* ========================================
   BrewApps.org - Shared Styles
   ======================================== */

:root {
    --bg: #fafafa;
    --bg-secondary: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent: #0071e3;
    --accent-hover: #0077ED;
    --border: #d2d2d7;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
    --max-width: 1120px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-secondary: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --accent: #2997ff;
    --accent-hover: #40a9ff;
    --border: #38383a;
    --card-bg: #1c1c1e;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.3);
    --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.5);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

/* ========================================
   Header / Navigation
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(250,250,250,0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

[data-theme="dark"] .site-header {
    background: rgba(0,0,0,0.8);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

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

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
}

.header-nav a:hover {
    color: var(--text);
}

.theme-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition);
    color: var(--text);
}

.theme-btn:hover {
    border-color: var(--accent);
    background: var(--card-bg);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    transition: all var(--transition);
}

.lang-switcher:hover {
    border-color: var(--accent);
}

.lang-option {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: all var(--transition);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.lang-option:hover {
    opacity: 0.8;
    color: var(--text-secondary);
}

.lang-option.active {
    opacity: 1;
    color: var(--accent);
    background: var(--bg);
}

[data-theme="dark"] .lang-option.active {
    background: #2c2c2e;
}

.lang-separator {
    color: var(--border);
    font-weight: 300;
    font-size: 0.85rem;
    user-select: none;
}

/* Mobile menu */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    position: relative;
}

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    position: absolute;
    left: 7px;
    transition: all 0.3s;
}

.mobile-toggle span:nth-child(1) { top: 11px; }
.mobile-toggle span:nth-child(2) { top: 17px; }
.mobile-toggle span:nth-child(3) { top: 23px; }

.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg); top: 16px; }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg); top: 16px; }

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========================================
   Hero - Landing Page
   ======================================== */
.hero {
    padding: 10rem 0 6rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

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

.hero .tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-weight: 400;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.badge:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========================================
   Section
   ======================================== */
.section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-header h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ========================================
   App Cards - Landing Page Grid
   ======================================== */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.app-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: transparent;
    color: var(--text);
}

.app-card-icon {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
    overflow: hidden;
}

.app-card-icon.mnmp {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app-card-icon.nmap {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Colori generici per future app */
.app-card-icon.green { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.app-card-icon.orange { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.app-card-icon.blue { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.app-card-icon.dark { background: linear-gradient(135deg, #434343 0%, #000000 100%); }

.app-card-icon .icon-text {
    font-size: 4rem;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1;
}

.app-card-body {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-card-body h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.app-card-body .app-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.app-card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.app-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg);
    border-radius: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

[data-theme="dark"] .tag {
    background: #2c2c2e;
}

/* ========================================
   App Page - Hero
   ======================================== */
.app-hero {
    padding: 8rem 0 4rem;
    text-align: center;
}

.app-hero .app-icon-large {
    width: 128px;
    height: 128px;
    border-radius: 28px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.app-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.app-hero .app-description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2rem;
}

.app-hero .version-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.app-hero .version-info strong {
    color: var(--text);
}

/* Download Button */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: var(--font);
}

.btn-download:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(0,113,227,0.4);
    color: #fff;
}

.btn-download .dl-icon {
    font-size: 1.2rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    font-family: var(--font);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
}

.download-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.download-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* ========================================
   App Page - Features
   ======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.75rem;
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: transparent;
    box-shadow: var(--card-shadow-hover);
}

.feature-card .feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========================================
   App Page - Requirements
   ======================================== */
.requirements {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 640px;
    margin: 0 auto;
}

.requirements h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.req-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.req-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.req-list li .req-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ========================================
   App Page - Screenshots
   ======================================== */
.screenshots-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0 2rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.screenshots-scroll::-webkit-scrollbar {
    height: 6px;
}

.screenshots-scroll::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

.screenshots-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.screenshot-item {
    flex-shrink: 0;
    width: 280px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.screenshot-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.screenshot-item img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    width: 100%;
    display: block;
}

/* Lightbox overlay */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    cursor: zoom-out;
    animation: lightboxFadeIn 0.2s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    object-fit: contain;
    cursor: default;
}

.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10000;
    background: none;
    border: none;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.screenshot-placeholder {
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: var(--card-bg);
}

/* ========================================
   Homebrew Note
   ======================================== */
.homebrew-note {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
}

.homebrew-note .homebrew-love {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.homebrew-note .homebrew-disclaimer {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-style: italic;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.site-footer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.site-footer a {
    color: var(--text-secondary);
}

.site-footer a:hover {
    color: var(--accent);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .header-nav {
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .header-nav.open {
        transform: translateX(0);
    }

    .header-nav a {
        font-size: 1.1rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 8rem 0 4rem;
    }

    .screenshot-item {
        width: 220px;
    }
}

/* ========================================
   Utility
   ======================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
