/*
 * webSlinger Tutorial Shared Stylesheet
 * Copyright (c) 2025 Gradient Research LLC
 * All rights reserved.
 */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #e0e6ed;
    background: linear-gradient(135deg, #0a0f2c 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    font-size: 1rem;
}

a {
    color: #00d4ff;
}

/* ===== Top Navigation Bar ===== */
.top-nav {
    background: rgba(0, 15, 44, 0.9);
    backdrop-filter: blur(15px);
    padding: 0.75rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.top-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00d4ff;
    text-decoration: none;
}

.top-nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.top-nav-links a {
    color: #e0e6ed;
    text-decoration: none;
    transition: color 0.3s;
}

.top-nav-links a:hover {
    color: #00d4ff;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    width: 230px;
    height: calc(100vh - 50px);
    background: rgba(0, 10, 30, 0.95);
    border-right: 1px solid rgba(0, 212, 255, 0.2);
    overflow-y: auto;
    padding: 20px 0;
    z-index: 900;
}

.sidebar-title {
    color: #00d4ff;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 20px 12px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    margin-bottom: 8px;
}

.sidebar-progress {
    height: 2px;
    background: rgba(0, 212, 255, 0.1);
    margin: 0 20px 12px;
}

.sidebar-progress-fill {
    height: 100%;
    background: #00d4ff;
    transition: width 0.3s;
}

.sidebar-list {
    list-style: none;
    padding: 0;
}

.sidebar-list li {
    margin: 0;
}

.sidebar-list a {
    display: block;
    padding: 8px 20px 8px 24px;
    color: #8892a4;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-list a:hover {
    color: #e0e6ed;
    background: rgba(0, 212, 255, 0.05);
}

.sidebar-list a.active {
    color: #00d4ff;
    border-left-color: #00d4ff;
    background: rgba(0, 212, 255, 0.08);
    font-weight: 600;
}

.sidebar-list a.completed {
    color: #00ff88;
}

/* Hamburger toggle for mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 55px;
    left: 10px;
    z-index: 950;
    background: rgba(0, 15, 44, 0.95);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    font-size: 1.4rem;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}

/* ===== Main Content Area ===== */
.main-content {
    margin-left: 230px;
    padding: 70px 40px 40px;
    max-width: 1130px;
}

/* ===== Page Sections (for showPage mechanism) ===== */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ===== Typography ===== */
h1 {
    color: #00d4ff;
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
}

h2 {
    color: #00d4ff;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    margin-top: 0.8rem;
}

h3 {
    color: #00bcd4;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    margin-top: 0.5rem;
}

p {
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 0.6rem;
}

li {
    margin-bottom: 0.3rem;
}

/* ===== Content Blocks ===== */
.content-block {
    background: rgba(0, 15, 44, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

/* ===== Highlight Boxes ===== */
.highlight-box {
    background: rgba(0, 212, 255, 0.1);
    border-left: 4px solid #00d4ff;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.highlight-box.info {
    border-left-color: #00bcd4;
    background: rgba(0, 188, 212, 0.1);
}

.highlight-box.success {
    border-left-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    background: linear-gradient(45deg, #00d4ff, #0099ff);
    color: #0a0f2c;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin: 3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: rgba(0, 15, 44, 0.9);
    color: #00d4ff;
    border: 2px solid #00d4ff;
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* ===== Screenshots / Images ===== */
.screenshot {
    max-width: 100%;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.2);
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: #00bcd4;
    margin-top: -5px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* ===== State Signature Grid ===== */
.state-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
    padding: 12px;
    background: rgba(0, 15, 44, 0.5);
    border-radius: 6px;
}

.state-cell {
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
}

.state-cell.main {
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid #00d4ff;
}

.state-cell.validation {
    background: rgba(0, 188, 212, 0.2);
    border: 2px solid #00bcd4;
}

.state-cell.copy {
    background: rgba(0, 153, 255, 0.2);
    border: 2px solid #0099ff;
}

/* ===== Interactive Demos ===== */
.interactive-demo {
    background: rgba(0, 15, 44, 0.6);
    border: 2px dashed rgba(0, 212, 255, 0.4);
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
    text-align: center;
}

.demo-element {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid #00d4ff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.demo-element:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: scale(1.05);
}

/* ===== Form Elements ===== */
input[type="text"], select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 15, 44, 0.8);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    color: #e0e6ed;
    font-size: 1rem;
    margin-bottom: 10px;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.data-table th, .data-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.data-table th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: bold;
}

.data-table tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

/* ===== Lightbox ===== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

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

.lightbox-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

/* ===== Nav Step Pages (standalone, no sidebar) ===== */
.nav-step-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

.nav-step-main {
    flex: 85;
    display: flex;
    flex-direction: column;
    background: rgba(0, 15, 44, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

.nav-step-main h2 {
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.nav-step-main .screenshot-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.nav-step-main .screenshot-area img {
    max-width: 100%;
    max-height: calc(100vh - 180px);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

.nav-step-main .caption-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 20px;
    flex-shrink: 0;
}

.nav-step-main .caption-row p {
    color: #ccc;
    font-size: 0.95rem;
    margin: 0;
}

/* Dual screenshot layout for step2, step3 */
.dual-screenshots {
    flex: 1;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.dual-screenshots .screenshot-card {
    flex: 1;
    background: rgba(0, 188, 212, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    position: relative;
}

.dual-screenshots .screenshot-card img {
    width: 100%;
    max-height: calc(100vh - 250px);
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dual-screenshots .screenshot-card .card-title {
    color: #00d4ff;
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.dual-screenshots .screenshot-card .card-desc {
    color: #ccc;
    font-size: 0.85rem;
    margin: 0;
}

/* Click-to-expand hint on lightbox images */
.lightbox-trigger {
    cursor: pointer;
    transition: opacity 0.2s;
    position: relative;
}

.lightbox-trigger:hover {
    opacity: 0.85;
}

.screenshot-card:hover .expand-hint,
.screenshot-area:hover .expand-hint {
    opacity: 1;
}

.expand-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #00d4ff;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.nav-step-sidebar {
    flex: 15;
    background: rgba(0, 15, 44, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

.nav-step-sidebar h3 {
    color: #00bcd4;
    margin-bottom: 12px;
    font-size: 1rem;
}

.nav-step-sidebar ul {
    margin-left: 1.2rem;
    line-height: 1.8;
    font-size: 0.9rem;
}

.nav-step-sidebar .workflow-desc {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    font-size: 0.9rem;
    color: #8892a4;
    line-height: 1.6;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 70px 20px 40px;
    }

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

    .button-group {
        flex-direction: column;
    }

    .nav-step-layout {
        flex-direction: column;
    }

    .dual-screenshots {
        flex-direction: column;
    }
}
