@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Color Palette - Dark (Default) */
    --primary: #10b981;
    --primary-bright: #34d399;
    --primary-glow: rgba(16, 185, 129, 0.15);
    --bg-main: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-header: rgba(10, 14, 23, 0.8);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --linkedin: #0077b5;
    
    /* Responsive Spacing */
    --container-max: 1100px;
    --section-padding: clamp(3rem, 8vw, 6rem);
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before, body::after {
    content: "";
    position: fixed;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

body::before { top: -10%; right: -10%; }
body::after { bottom: -10%; left: -10%; }

/* Common Layout */
main {
    padding-top: calc(var(--header-height) + 40px);
    min-height: 80vh;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 2rem);
}

p {
    max-width: 75ch; /* Optimal for readability */
}

.hero p, .hero-compact p {
    margin-left: auto;
    margin-right: auto;
}

/* Header / Navigation */
header {
    background: var(--bg-header);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

header.scrolled {
    height: 70px;
    background: var(--bg-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(10px, 3vw, 60px);
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    flex-shrink: 0;
}

.brand i {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 3rem; /* Even more space between links */
    list-style: none;
    margin: 0 auto;
    flex-shrink: 1;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Action Group */
.nav-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 25px; /* More space between buttons */
    flex-shrink: 0;
    margin-left: 30px; 
}

.no-mobile {
    display: inline-flex;
}

@media (max-width: 900px) {
    .no-mobile {
        display: none !important;
    }
}

@media (max-width: 1150px) {
    .nav-links {
        gap: 1.5rem;
    }
    .nav-flex {
        gap: 20px;
    }
}

/* Hero Sections */
.hero {
    padding: var(--section-padding) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 30%, var(--primary-glow) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, var(--primary-glow) 0%, transparent 40%);
}

.hero-compact {
    padding: calc(var(--header-height) + 60px) 0 60px;
    text-align: center;
    background: radial-gradient(circle at center, var(--primary-glow) 0%, transparent 70%);
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -2px;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 40px;
}

.hero-compact h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

/* Grid & Cards */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.card {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(17, 24, 39, 0.5) 100%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    text-align: left;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-main);
    backdrop-filter: blur(5px);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    background: var(--bg-card-hover);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 20px var(--primary-glow);
}

.card .icon-box {
    width: 50px;
    height: 50px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Form Styles for Generator */
.step-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 50px;
    /* More internal space */
    border: 1px solid var(--border);
    max-width: 800px;
    margin: 60px auto;
    /* Increased margin */
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
    opacity: 0.9;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    background: rgba(255, 255, 255, 0.08);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
    padding-right: 45px;
}

select.form-control option {
    background-color: #111827; /* Solid dark background for options */
    color: #ffffff;
    padding: 10px;
}

/* Dashboard Widgets for Report */
.widget {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--bg-card-hover);
    border-top: 8px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.btn-outline {
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text-main) !important;
}

.btn-outline:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: var(--primary-glow) !important;
}

/* Footer */
footer {
    padding: 80px 0 40px;
    margin-top: 100px;
    border-top: 1px solid var(--border);
    background: linear-gradient(to top, #000, transparent);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Navigation Overrides */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
}

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

    .nav-links {
        display: none; /* Default hidden */
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
        gap: 15px;
        text-align: center;
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }

    .grid-2-resp {
        grid-template-columns: 1fr !important;
    }

    .hero-compact h1 {
        font-size: 2rem;
    }

    .step-container, .report-sheet {
        padding: 25px;
    }

    .sheet-grid, .summary-bar {
        grid-template-columns: 1fr !important;
    }
}

/* Helper Class for Responsive 2-column grids */
.grid-2-resp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

@media (max-width: 768px) {
    header {
        height: 60px;
    }
    main {
        padding-top: 80px;
    }
    .nav-links {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: var(--bg-main);
        flex-direction: column;
        align-items: center;
        padding: 40px 0;
        transition: 0.3s ease;
        z-index: 999;
    }
    .nav-links.active {
        left: 0;
    }
}

.nav-links.active {
    animation: slideDown 0.3s ease forwards;
}

.theme-btn {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--border);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* Tooltip Engine */
.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 50%;
    font-size: 10px;
    margin-left: 5px;
    cursor: help;
    vertical-align: middle;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 10;
    bottom: 150%;
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
    border: 1px solid var(--border);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--border) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Technical Report Sheet UI */
.report-sheet {
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: clamp(2rem, 5vw, 5rem);
    margin-bottom: 50px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.audit-meta {
    text-align: right;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-main); /* Brighter for contrast */
    opacity: 0.8;
}

.sheet-title {
    margin-bottom: 30px;
}

.sheet-title h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.summary-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.summary-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    text-align: center;
}

.summary-item .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.summary-item .val {
    font-size: 1.5rem;
    font-weight: 700;
}

.sheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.asset-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.asset-table th {
    text-align: left;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.asset-table td {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
}

.insight-mini {
    background: var(--glass);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.insight-mini:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
}

.insight-mini strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.insight-mini p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sheet-footer {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.methodology-box {
    max-width: 50%;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.signature-area {
    display: flex;
    gap: 40px;
}

.sig-box {
    text-align: center;
}

.sig-line {
    width: 220px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--text-muted), transparent);
    margin-bottom: 10px;
}

.sig-box span {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Animations */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* LinkedIn Card Styles */
.share-section {
    margin-top: 80px;
    padding: 60px 0;
    border-top: 1px solid var(--border);
}

.linkedin-card {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1200 / 627;
    /* Standard LinkedIn share ratio */
    height: auto;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    position: relative;
    padding: 30px;
    overflow: hidden;
    margin: 20px auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.linkedin-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 60%);
    z-index: 0;
}

.card-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    z-index: 1;
}

.card-logo i {
    color: var(--primary);
}

.card-score {
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 1;
}

.score-big {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary) !important;
    line-height: 1;
}

.score-meta h4,
.score-meta p,
.card-logo span,
.card-footer div {
    color: #fff !important;
}

.score-meta h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 1;
}

.certified-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Print Styles for A4 PDF */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt;
        line-height: 1.2; /* Tighter line height */
    }

    main {
        padding-top: 0 !important; /* Crucial: Remove big top padding for fixed header */
        min-height: auto !important;
    }

    header,
    footer,
    .share-section,
    .btn,
    .nav-links,
    .no-print,
    .hero-compact,
    .stepper {
        display: none !important;
    }

    .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-sheet {
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        max-width: 100% !important;
        box-shadow: none !important;
    }

    .sheet-header {
        margin-bottom: 5px !important;
        padding-bottom: 5px !important;
    }

    .sheet-title {
        margin-bottom: 5px !important;
    }

    .sheet-title h1 {
        font-size: 1.2rem !important;
        margin-bottom: 0 !important;
    }

    .summary-bar {
        background: #f1f5f9 !important;
        border-color: #cbd5e1 !important;
        margin-bottom: 8px !important;
    }

    .summary-item {
        background: #fff !important;
        padding: 4px !important;
    }

    .summary-item .val {
        font-size: 0.95rem !important;
    }

    .widget {
        padding: 8px 12px !important;
        margin-bottom: 4px !important;
        border: 1px solid #e2e8f0 !important;
        background: #fff !important;
    }

    .widget h3 {
        font-size: 0.85rem !important;
        margin-bottom: 4px !important;
    }

    .asset-table td, .asset-table th {
        padding: 3px 0 !important;
        font-size: 0.7rem !important;
    }

    canvas {
        max-height: 85px !important;
    }

    .insight-mini {
        padding: 6px 10px !important;
        font-size: 0.7rem !important;
        border: 1px solid #e2e8f0 !important;
    }

    .sheet-footer {
        margin-top: 5px !important;
        padding-top: 5px !important;
    }

    .signature-area {
        gap: 20px !important;
        margin-top: 15px !important;
    }

    .sig-line {
        width: 140px !important;
        background: #000 !important;
    }

    .score-big, .certified-badge, i {
        color: var(--primary) !important;
        -webkit-print-color-adjust: exact;
    }
}

/* Professional Wizard & UI Enhancements */
.step-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 50px;
    position: relative;
}

.stepper::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 1;
    transform: translateY(-50%);
}

.step-node {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 2;
    transition: var(--transition);
    position: relative;
    font-size: 0.9rem;
}

.step-node.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.step-node.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.sig-box span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #cbd5e1; /* Brighter for readability */
    font-weight: 600;
}

.step-node.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 500px) {
    .step-label {
        display: none;
    }
    .stepper {
        margin-bottom: 30px;
    }
}

/* Glass Input Enhancement */
.glass-control {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    color: var(--text-main) !important;
}

.glass-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 20px var(--primary-glow);
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Live Impact Sidebar */
.live-impact-bar {
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    margin-top: 40px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.live-stat {
    text-align: center;
}

.live-stat .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.live-stat .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

/* Telemetry Scan Animation */
@keyframes scan-line {
    0% { top: 0; }
    100% { top: 100%; }
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 185, 129, 0.05);
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    display: none;
    border-radius: 12px;
}

.scan-overlay::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    animation: scan-line 2s linear infinite;
}

/* Form Grid Fixes */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}