/* ═══════════════════════════════════════════════════════════
   Snailink — Page-Specific Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Landing Page ──────────────────────────────────────── */
.landing-hero {
    text-align: center;
    padding: 80px var(--space-lg) 60px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg,
            rgba(245, 240, 232, 0) 0%,
            rgba(245, 240, 232, 0.15) 30%,
            rgba(245, 240, 232, 0.7) 65%,
            rgba(245, 240, 232, 0.95) 85%,
            var(--bg-primary) 100%
        ),
        url('../assets/img/fondo.png') center top / cover no-repeat;
    border-bottom: none;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.landing-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-green);
    opacity: 0.3;
}

.landing-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-sm);
    image-rendering: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
    position: relative;
    z-index: 1;
}

.landing-title {
    font-size: 28px;
    margin-bottom: var(--space-sm);
    color: var(--accent-green);
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(255,255,255,0.7);
}

.landing-subtitle {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto var(--space-xl);
    line-height: 1.8;
}

.landing-cta {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
}

.landing-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.landing-stats strong {
    display: block;
    font-size: 16px;
    color: var(--accent-green);
    margin-bottom: 4px;
}

/* ── Feature Section ───────────────────────────────────── */
.features-section {
    padding: var(--space-xxl) var(--space-md);
}

.section-title {
    font-size: 14px;
    text-align: center;
    margin-bottom: var(--space-xl);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.section-title::before,
.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border-color);
    max-width: 100px;
}

.feature-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-lg);
    transition: transform 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--border-color);
}

.feature-icon {
    font-size: 22px;
    margin-bottom: var(--space-md);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    font-family: var(--font-pixel);
    line-height: 1;
}

.feature-title {
    font-family: var(--font-pixel);
    font-size: 9px;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.feature-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── How it Works ──────────────────────────────────────── */
.how-section {
    padding: var(--space-xxl) var(--space-md);
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

.how-step {
    text-align: center;
    padding: var(--space-lg);
}

.how-step-number {
    font-family: var(--font-pixel);
    font-size: 24px;
    color: var(--accent-green);
    margin-bottom: var(--space-sm);
}

.how-step-title {
    font-family: var(--font-pixel);
    font-size: 9px;
    margin-bottom: var(--space-sm);
}

.how-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ── Auth Page ─────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height));
    padding: var(--space-xl);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-logo img {
    width: 64px;
    margin-bottom: var(--space-md);
}

.auth-logo h2 {
    color: var(--accent-green);
}

.otp-input-container {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin: var(--space-lg) 0;
}

.otp-digit {
    width: 44px;
    height: 52px;
    text-align: center;
    font-family: var(--font-pixel);
    font-size: 18px;
    border: 2px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
}

.otp-digit:focus {
    border-color: var(--accent-green);
    outline: none;
    background: #fff;
}

/* ── Dashboard ─────────────────────────────────────────── */
.dashboard-page {
    padding: var(--space-xl) var(--space-md);
    max-width: var(--max-width);
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.dashboard-map-container {
    margin-bottom: var(--space-xl);
    border: var(--pixel-border) solid var(--border-dark);
    box-shadow: 4px 4px 0 var(--shadow-color);
    overflow: hidden;
}

.dashboard-map {
    height: 350px;
    width: 100%;
    background: var(--bg-secondary);
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-md);
}

/* ── Device Card ───────────────────────────────────────── */
.device-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-lg);
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}

.device-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 var(--border-color);
    border-color: var(--accent-green);
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.device-card-name {
    font-family: var(--font-pixel);
    font-size: 10px;
}

.device-card-info {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.device-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border-color);
    font-size: 10px;
    color: var(--text-muted);
}

/* ── Device Detail ─────────────────────────────────────── */
.device-page {
    padding: var(--space-xl) var(--space-md);
    max-width: var(--max-width);
    margin: 0 auto;
}

.device-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.stream-container {
    border: var(--pixel-border) solid var(--border-dark);
    box-shadow: 4px 4px 0 var(--shadow-color);
    background: #000;
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.stream-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stream-overlay {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    display: flex;
    gap: var(--space-sm);
}

.stream-live-badge {
    font-family: var(--font-pixel);
    font-size: 7px;
    padding: 4px 8px;
    background: var(--accent-red);
    color: #fff;
    border: 2px solid #fff;
    animation: pulse 2s infinite;
}

.detection-log {
    max-height: 400px;
    overflow-y: auto;
}

.detection-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.detection-item:last-child {
    border-bottom: none;
}

.detection-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.detection-result {
    font-family: var(--font-pixel);
    font-size: 8px;
}

.detection-result.alert {
    color: var(--accent-red);
}

.detection-result.safe {
    color: var(--accent-green);
}

/* ── Config Panel ──────────────────────────────────────── */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.config-section {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-lg);
}

.config-section-title {
    font-family: var(--font-pixel);
    font-size: 9px;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.led-preview {
    width: 100%;
    height: 40px;
    border: 2px solid var(--border-dark);
    margin: var(--space-md) 0;
    transition: background-color 0.3s;
}

/* ── Profile Page ──────────────────────────────────────── */
.profile-page {
    padding: var(--space-xl) var(--space-md);
    max-width: 600px;
    margin: 0 auto;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border: var(--pixel-border) solid var(--border-dark);
    box-shadow: 3px 3px 0 var(--shadow-color);
    background: var(--accent-green-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto var(--space-lg);
}

/* ── Legal Pages ───────────────────────────────────────── */
.legal-page {
    padding: var(--space-xl) var(--space-md);
    max-width: 800px;
    margin: 0 auto;
}

.legal-page h1 {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: var(--pixel-border) solid var(--border-dark);
}

.legal-page h2 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    color: var(--accent-green);
}

.legal-page p,
.legal-page ul {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.legal-page ul {
    padding-left: var(--space-xl);
}

.legal-page li {
    margin-bottom: var(--space-sm);
}

/* ── Leaflet overrides ─────────────────────────────────── */
.leaflet-container {
    font-family: var(--font-mono) !important;
}

.snailink-marker {
    background: none;
    border: none;
}

.marker-icon-inner {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.3));
}

.leaflet-popup-content-wrapper {
    border-radius: 0 !important;
    border: 2px solid var(--border-dark) !important;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2) !important;
}

.leaflet-popup-tip {
    display: none !important;
}

/* ── About / Documentation Page ───────────────────────── */
.about-page {
    padding: var(--space-xl) var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
}

.about-page h1 {
    margin-bottom: var(--space-md);
}

.about-page h2 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    color: var(--accent-green);
}

.about-page p {
    max-width: 680px;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.about-page ul {
    padding-left: var(--space-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.about-page li {
    margin-bottom: var(--space-sm);
}

.about-page pre {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 12px;
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

.about-hero {
    text-align: center;
    padding: 60px var(--space-lg) 40px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg,
            rgba(245, 240, 232, 0) 0%,
            rgba(245, 240, 232, 0.2) 35%,
            rgba(245, 240, 232, 0.75) 65%,
            var(--bg-primary) 100%
        ),
        url('../assets/img/fondo.png') center top / cover no-repeat;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.spec-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-lg);
}

.spec-card-title {
    font-family: var(--font-pixel);
    font-size: 8px;
    color: var(--accent-green);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
}

.spec-card-value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}
