:root {
    --primary: #1B263B;
    --secondary: #F4D35E;
    --accent: #0077B6;
    --white: #FFFFFF;
    --light-bg: #F8F9FA;
    --text-main: #333333;
    --text-muted: #666666;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    --glass: rgba(255, 255, 255, 0.95);
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --header-height: 120px; /* Safe zone for logo/nav */
}

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

body, html {
    height: 100%;
    width: 100%;
    font-family: var(--font-body);
    color: var(--text-main);
    overflow: hidden;
}

/* Background Elements */
.slideshow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out, transform 10s linear;
    transform: scale(1.1);
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(27, 38, 59, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: -1;
}

main {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start; /* Switch to flex-start to prevent top-overlap */
    height: 100vh;
    padding: 0 40px; /* Horizontal padding only */
    padding-top: var(--header-height); /* Ensure we start below logo/nav */
    z-index: 1;
}

/* WeTransfer Widget Style */
.wetransfer-widget {
    background: var(--glass);
    width: 100%;
    max-width: 440px;
    height: auto;
    max-height: calc(100vh - var(--header-height) - 40px);
    min-height: 480px;
    border-radius: 32px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    padding: 25px; /* Slightly tighter padding for 3-widget layout */
    position: relative;
    backdrop-filter: blur(20px);
    animation: slideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; 
}

.wetransfer-widget::-webkit-scrollbar {
    width: 6px;
}

.wetransfer-widget::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.wetransfer-widget.expanded {
    max-width: 1400px;
    width: 95%;
    height: 100%; /* Important: Force height to allow internal scrolling */
    background: rgba(255, 255, 255, 0.98);
}

@keyframes slideIn {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Global Header & Branding --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-container img {
    height: 60px; /* Larger logo */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-text {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 20px;
    color: var(--white); /* High contrast on dark BG */
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo-text span {
    color: var(--secondary);
    font-weight: 300;
}

.top-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    background: none;
    border: none;
    color: var(--white);
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 10px 0;
    position: relative;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.nav-link:hover, .nav-link.active {
    opacity: 1;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary);
}

.link-highlight {
    background: var(--secondary);
    color: var(--primary);
    padding: 8px 20px !important;
    border-radius: 50px;
    opacity: 1;
}

.link-highlight:hover {
    transform: scale(1.05);
}

.link-highlight.active::after {
    display: none;
}

/* Content Area */
.widget-content {
    flex-grow: 1;
    overflow: hidden; /* Locked down */
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    height: 100%;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

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

h1 {
    font-family: var(--font-header);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}

/* UI Elements */
.cta-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 18px 24px;
    border-radius: 50px;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(27, 38, 59, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #23314B;
    box-shadow: 0 8px 25px rgba(27, 38, 59, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 16px 24px;
    border-radius: 50px;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(27, 38, 59, 0.05);
}

.input-group, .form-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

input, textarea {
    width: 100%;
    padding: 14px 0;
    border: none;
    border-bottom: 2px solid #EEE;
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    background: transparent;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    border-color: var(--primary);
}

textarea {
    height: 80px;
    resize: none;
}

/* Advanced Calculator Styles (3-Widget Architecture) */
.calculator-grid {
    display: flex;
    gap: 25px;
    margin-top: 10px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.params-widget {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 24px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.params-widget::-webkit-scrollbar { width: 4px; }
.params-widget::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

.sim-widget {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto; /* Allow independent scrolling if diagrams are tall */
    padding-right: 5px;
}

.sim-widget::-webkit-scrollbar { width: 4px; }
.sim-widget::-webkit-scrollbar-thumb { background: #eee; border-radius: 10px; }

.perf-widget {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    border: 1px solid #eee;
    overflow-y: auto; /* Independent scroll */
}


.simulation-controls {
    background: #f8f9fa;
    padding: 20px 25px;
    border-radius: 20px;
    margin-top: auto;
}

.simulation-controls .input-group {
    margin-bottom: 15px;
}

.simulation-controls .input-group:last-child {
    margin-bottom: 0;
}

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

.calc-sub-header {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    margin-top: 15px;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 8px;
    letter-spacing: 1.5px;
}

.slider-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.slider-label span {
    color: var(--accent);
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.calc-viz {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto; /* Independent scroll fallback */
    padding-right: 5px;
}

.calc-viz::-webkit-scrollbar { width: 4px; }
.calc-viz::-webkit-scrollbar-thumb { background: #eee; border-radius: 10px; }

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

.viz-card {
    background: #fdfdfd;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.viz-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}

canvas {
    width: 100%;
    max-height: 180px; /* Constrain height to ensure sliders are visible */
    height: auto;
    display: block;
}

.results-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.res-card {
    background: var(--white);
    padding: 20px 15px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #eee;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.res-card.highlight {
    background: rgba(0, 119, 182, 0.05);
    border-color: var(--accent);
}

.res-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.res-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.res-value small {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.res-card.highlight .res-value {
    color: var(--accent);
}

.custom-select {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid #EEE;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    background: transparent;
    cursor: pointer;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    main {
        padding: 0;
        align-items: flex-end;
    }
    
    .wetransfer-widget {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        min-height: 80vh;
        padding: 30px;
    }

    .widget-content {
        max-height: calc(80vh - 150px);
    }

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