/* --- Variables --- */
:root {
    --primary-dark-blue: #003366;
    --primary-light-blue: #005A9C;
    --accent-green: #28a745;
    --light-accent-blue: #5D9CEC;
    --neutral-bg: #f4f7f6;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --text-dark: #333333;
    --text-light: #f8f9fa;
    --text-muted: #6c757d;

    --sidebar-width: 260px;
    --sidebar-width-collapsed: 60px;
    --header-height: 60px;
    --transition-speed: 0.3s ease;

    /* Fonts */
    --primary-font: 'Candara', 'Calibri', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    --heading-font: 'Montserrat', sans-serif; /* For general headings like h2-h6, card titles */
    --zone-title-font: 'Lora', serif; /* For main zone titles (h1) */
}

/* --- General Styles --- */
body {
    font-family: var(--primary-font);
    font-size: 16px; /* Base font size */
    margin: 0;
    background-color: var(--neutral-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font); /* Default heading font */
    color: var(--primary-dark-blue);
    margin-top: 0;
}

a {
    color: var(--primary-light-blue);
    text-decoration: none;
}
a:hover {
    color: var(--accent-green);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color var(--transition-speed), transform 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-primary {
    background-color: var(--accent-green);
    color: white;
}
.btn-primary:hover {
    background-color: #1e7e34;
    transform: translateY(-2px);
}
.btn-secondary {
    background-color: var(--primary-light-blue);
    color: white;
}
.btn-secondary:hover {
    background-color: var(--primary-dark-blue);
    transform: translateY(-2px);
}
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}


/* --- Splash Screen --- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-dark-blue) 0%, var(--primary-light-blue) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.7s ease-in-out;
}
.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}
.splash-content {
    text-align: center;
    color: white;
}
.splash-content img { /* Style for splash screen logo */
    max-height: 80px;
    margin-bottom: 1rem;
}
.splash-title {
    font-family: var(--zone-title-font); /* Lora for splash title */
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: white;
}
.splash-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--accent-green);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.btn-enter {
    margin-top: 1.5rem;
    background-color: var(--accent-green);
    border: 2px solid white;
}
.btn-enter:hover {
    background-color: white;
    color: var(--accent-green);
}

/* --- App Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: #ffffff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    transition: width var(--transition-speed);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    overflow: hidden;
}
.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-title-text
{
    display: none;
    opacity: 0;
    transition: opacity 0.1s ease-out;
}
.sidebar .nav-text, .sidebar .sidebar-title-text {
    opacity: 1;
    transition: opacity 0.2s 0.1s ease-in;
}

.sidebar-header {
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    box-sizing: border-box;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.sidebar-title-text {
    font-family: var(--zone-title-font); /* Lora for sidebar title */
    font-size: 1.5rem;
    color: var(--primary-dark-blue);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* flex-grow: 1; Let it take natural width */
    padding-right: 10px; /* Space before toggle button */
}
.sidebar-title-accent {
    font-family: var(--primary-font);
    font-size: 0.8rem;
    color: var(--accent-green);
    font-weight: 500;
    margin-left: 4px;
}


.sidebar-toggle-btn {
    background: none;
    border: none;
    color: var(--primary-dark-blue);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto; /* Pushes button to the right */
}
.sidebar.collapsed .sidebar-toggle-btn {
    margin-left: 0; /* No margin needed when centered */
}


.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.5rem;
    color: var(--primary-dark-blue);
    text-decoration: none;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    border-left: 4px solid transparent;
    white-space: nowrap;
}
.sidebar-nav .nav-link i {
    margin-right: 1rem;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 0.9rem 0;
}
.sidebar.collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
    font-size: 1.3rem;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--neutral-bg);
    color: var(--accent-green);
    border-left-color: var(--accent-green);
}
.sidebar-nav .nav-link.active {
    background-color: var(--accent-green);
    color: white;
    border-left-color: var(--primary-dark-blue);
    font-weight: 500;
}
.sidebar-nav .nav-link.active i {
    color: white;
}
.sidebar-nav .nav-link.disabled {
    color: #aaa;
    pointer-events: none;
    opacity: 0.7;
}


/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed);
    background-color: var(--neutral-bg);
    overflow-y: auto;
}
.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-width-collapsed);
}

.content-zone {
    display: none; /* Hidden by default */
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}
.content-zone.active-zone {
    /* display property is set by JS based on zone type (block or flex) */
}
/* Ensure profile zone uses flex when active */
#zone-profile.active-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.simple-profile-zone {
    /* display: flex; Handled by #zone-profile.active-zone */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(80vh - var(--header-height) - 4rem);
}

.simple-intake-form {
    background-color: var(--card-background);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}
.simple-intake-form .form-group {
    margin-bottom: 1.5rem;
}
.simple-intake-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-dark-blue);
}
.simple-intake-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}
.simple-intake-form input[type="text"]:focus {
    border-color: var(--primary-light-blue);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 90, 156, 0.2);
}


.zone-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-green);
}
.zone-header h1 {
    font-family: var(--zone-title-font); /* Lora for Zone Titles */
    font-size: 2.4rem; /* Slightly larger */
    margin-bottom: 0.3rem;
}
.zone-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.zone-content-steps {
    /* For Zone 1 style content */
}
.concept-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--light-accent-blue);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.concept-card .card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}
.concept-card .card-header i {
    font-size: 1.8rem;
    color: var(--primary-light-blue);
    margin-right: 1rem;
}
.concept-card .card-title {
    font-family: var(--heading-font); /* Montserrat for card titles */
    font-size: 1.5rem; /* Slightly larger */
    color: var(--primary-dark-blue);
    margin-bottom: 0;
}
.concept-card .card-text {
    margin-bottom: 1rem;
    color: #444;
}
.card-interactive-placeholder, .card-image-container {
    background-color: #e9ecef;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    color: var(--text-muted);
    margin-top: 1rem;
}
.card-image-container {
    padding: 0;
    background-color: transparent;
}
.concept-image {
    max-width: 100%;
    max-height: 350px;
    border-radius: 4px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}


.zone-navigation {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* --- Zone 2: Use Case Exploration Specific Styles --- */
.zone2-step-container {
    margin-bottom: 2rem;
}
#zone2-domain-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.domain-block {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    border-left: 5px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px; /* Ensure blocks have some height */
}
.domain-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.15); /* Using primary-dark-blue with opacity */
    border-left-color: var(--accent-green);
}
.domain-block i {
    font-size: 2.8rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
    display: block;
}
.domain-block h4 {
    font-family: var(--heading-font); /* Montserrat for domain titles */
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark-blue);
}
.domain-block p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Zone 2 Use Case Selector - styled like domain blocks */
#zone2-usecase-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.usecase-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 1.5rem; /* Consistent padding */
    border-radius: 10px; /* Consistent border-radius */
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    border-left: 5px solid transparent; /* Start with transparent left border */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px; /* Consistent height with domain blocks */
}
.usecase-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 90, 156, 0.15); /* Using primary-light-blue with opacity */
    border-left-color: var(--accent-green);
}
.usecase-card i { /* Icon for use case card */
    font-size: 2.8rem;
    color: var(--primary-light-blue); /* Different color for distinction */
    margin-bottom: 1rem;
    display: block;
}
.usecase-card h4 { /* Title for use case card - changed from h5 for consistency */
    font-family: var(--heading-font);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark-blue);
}
.usecase-card p { /* Description for use case card */
    font-size: 0.95rem;
    color: var(--text-muted);
}


/* Styles for Zone 2 Detail Viewer (previously PDF Viewer) */
#detail-viewer-container { /* Renamed from #pdf-viewer-container */
    position: relative; /* Needed for absolute positioning of the child image */
    width: 100%; 
    max-width: 794px; /* Approx A4 width at 96dpi (210mm). Adjust as desired. */
    margin: 10px auto; /* Centering the container */
    border: 1px solid #ccc;
    background-color: #f9f9f9; /* Light background for the viewer area */
    box-sizing: border-box;
    overflow: hidden; /* Hide any part of the image that might overflow due to aspect ratio differences */
    
    /* A4 Aspect Ratio (Landscape: 297/210 = 1.414; Portrait: 210/297 = 0.707) */
    /* We'll aim for portrait. Height will be 141.4% of the width */
    /* If your images are landscape, use (210/297 * 100)% = 70.70% */
    padding-bottom: 90%; /* This creates the aspect ratio box for portrait A4 */
    /* If you expect mostly landscape A4s, use: padding-bottom: 70.70%; */
    height: 0; /* Important for the padding-bottom trick to work */
}
.usecase-detail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;  /* Image will fill the container's width */
    height: 100%; /* Image will fill the container's height (defined by padding-bottom) */
    object-fit: contain; /* This is key:
                            - Scales the image down to fit within the content box.
                            - Preserves its aspect ratio.
                            - Letterboxes if aspect ratios don't match container's available space. */
    padding: 1px; /* Optional padding around the image, inside the container */
    box-sizing: border-box; /* Ensure padding is included in width/height */
 }

/* --- Zone 3: AI Sandbox Specific Styles --- */
#zone3-domain-selector { /* For problem-driven domain selection */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.problem-statement-card {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid var(--light-accent-blue);
}
.problem-statement-card:hover {
    background-color: #efefef;
    transform: translateX(3px);
    box-shadow: 2px 2px 8px rgba(0,0,0,0.07);
}
.problem-statement-card h5 {
    font-family: var(--heading-font);
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-dark-blue);
    font-size: 1.2rem; /* Slightly larger */
}
.problem-statement-card p {
    font-size: 0.95rem;
    color: #555;
}

.problem-details-in-tools {
    background-color: #e9ecef;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}
.problem-details-in-tools h3 {
    font-family: var(--heading-font);
    margin-top: 0;
}


.tool-category-group {
    margin-bottom: 2rem;
}
.tool-category-group h4 {
    font-family: var(--heading-font);
    font-size: 1.4rem;
    color: var(--primary-dark-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}
.tool-list-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tool-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 80px;
    height: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
.tool-icon-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.tool-icon-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: 4px;
}
.tool-icon-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.tool-icon-fallback {
    font-size: 2.5rem;
    color: var(--primary-light-blue);
}


/* Zone 3 New Navigation Option Blocks */
.zone3-initial-options-container {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}
.zone3-nav-option-block {
    flex-basis: 45%;
    min-width: 280px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-light-blue);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.07);
}
.zone3-nav-option-block:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.12); /* Using primary-dark-blue with opacity */
    border-left-color: var(--accent-green);
}
.zone3-nav-option-block i {
    font-size: 3rem;
    color: var(--accent-green);
    margin-bottom: 1rem;
}
.zone3-nav-option-block h3 {
    font-family: var(--heading-font); /* Montserrat for these titles */
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}
.zone3-nav-option-block p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Zone 3 General Tools Directory Specific Styles */
#zone3-general-tools-directory h2 {
    font-family: var(--heading-font);
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}
.tool-category-general-block {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.tool-category-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
}
.tool-category-header.open {
    border-bottom-color: var(--border-color);
}
.tool-category-header h4 {
    font-family: var(--heading-font); /* Montserrat for category titles */
    font-size: 1.3rem;
    margin: 0;
    color: var(--primary-dark-blue);
}
.tool-category-header h4 i {
    margin-right: 0.75rem;
    color: var(--light-accent-blue);
}
.tool-category-header .toggle-icon {
    transition: transform 0.3s ease;
}
.tool-category-header.open .toggle-icon {
    transform: rotate(90deg);
}
.tool-category-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}
.tool-category-content.open {
    max-height: 1000px;
}


/* --- Zone 4: Roadmap --- */
.roadmap-content .profile-recap {
    background-color: #eef4f8;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 5px solid var(--primary-light-blue);
}
.roadmap-content .profile-recap p {
    margin-bottom: 0.5rem;
}
.roadmap-content .profile-recap strong {
    color: var(--primary-dark-blue);
}
.roadmap-content .concept-card {
    margin-bottom: 2rem;
}
.roadmap-content .concept-card ul {
    padding-left: 20px;
}
.roadmap-content .concept-card li {
    margin-bottom: 0.5rem;
}


/* Responsive Adjustments */
@media (max-width: 992px) {
    .sidebar {
        left: -100%;
    }
    .sidebar.expanded {
        left: 0;
        width: var(--sidebar-width);
    }
    .sidebar.collapsed {
        left: 0;
        width: var(--sidebar-width-collapsed);
    }
    .main-content {
        margin-left: var(--sidebar-width-collapsed);
        padding: 1.5rem;
    }
    .sidebar.expanded ~ .main-content {
        margin-left: var(--sidebar-width-collapsed);
    }

    .zone-header h1 { font-size: 2rem; } /* Adjust for smaller screens */
    .zone-header p { font-size: 1rem; }
    .btn { padding: 0.6rem 1.2rem; font-size: 0.9rem;}
}

@media (max-width: 768px) {
    #zone2-domain-selector,
    #zone2-usecase-selector, /* Apply to usecase selector as well */
    #zone3-domain-selector {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .tool-list-horizontal {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    :root {
        font-size: 15px; /* Slightly reduce base font size for very small screens */
    }
    .splash-title { font-size: 2.5rem; }
    .splash-subtitle { font-size: 1.1rem; }
    .main-content { padding: 1rem; }
    .simple-intake-form { padding: 1.5rem; }
    .zone3-nav-option-block {
        flex-basis: 100%; /* Stack Zone 3 options on very small screens */
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Ensure it's on top */
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    min-width: 300px;
    max-width: 80%;
}

.modal-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}
