/* Architect Page Styling */

:root {
    --sidebar-width: 450px;
    --sidebar-bg: #F8F7F6;
    --preview-bg: #EAEAEA;
    /* Darker grey for contrast behind paper */
}

body {
    background: var(--preview-bg);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    /* V6 Fix: Allow scrolling for long result pages */
}

/* Main Layout */
.architect-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Dynamic Canvas Styles (V8) */
.architect-preview {
    flex: 1;
    background: #F0F2F5;
    position: relative;
    /* overflow: hidden; Removed to allow scrolling result page */
    display: flex;
    flex-direction: column;
}

#dynamic-viz-container {
    position: relative;
    /* Changed to relative for flow */
    margin: 40px auto;
    width: 600px;
    height: auto;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2;
    padding: 20px;
}

/* Dossier Styles */
.dossier-header {
    text-align: center;
    margin-bottom: 20px;
    color: var(--secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    /* Increased gap for red dot */
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #FF5A5F;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.7);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 90, 95, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 90, 95, 0);
    }
}

.dossier-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary);
    opacity: 0;
    /* Animation handled by JS */
}

.dossier-item.alert-item {
    border-left-color: #D13438;
    background: #FFF0F0;
}

.dossier-icon {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 16px;
    opacity: 0.8;
}

/* Icons via simple CSS or shapes for now, could use images */
.dossier-icon.crm-bullseye {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%23008272" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10" stroke="%23008272" stroke-width="2" fill="none"/><circle cx="12" cy="12" r="6" fill="%23008272"/></svg>');
}

.dossier-icon.database {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%23008272" xmlns="http://www.w3.org/2000/svg"><path d="M12 2C6.48 2 2 4.02 2 6.5S6.48 11 12 11 22 8.98 22 6.5 17.52 2 12 2zm0 13c-5.52 0-10-2.02-10-4.5V16c0 2.48 4.48 4.5 10 4.5s10-2.02 10-4.5v-5.5c0 2.48-4.48 4.5-10 4.5z" fill="%23008272"/></svg>');
}

.dossier-icon.server {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%23008272" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="20" height="8" rx="2" fill="%23008272"/><rect x="2" y="14" width="20" height="8" rx="2" fill="%23008272"/></svg>');
}

.dossier-icon.warning {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%23D13438" xmlns="http://www.w3.org/2000/svg"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" fill="%23D13438"/></svg>');
}

.dossier-icon.flag {
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="%230078D4" xmlns="http://www.w3.org/2000/svg"><path d="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z" fill="%230078D4"/></svg>');
}


.dossier-content {
    display: flex;
    flex-direction: column;
}

.dossier-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

.dossier-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.viz-placeholder {
    grid-area: 2 / 2 / 3 / 3;
    text-align: center;
    color: #888;
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Sidebar */
.architect-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid #E1DFDD;
    padding: 32px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
    margin-bottom: 32px;
}

.back-link {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 24px;
    display: inline-block;
}

.back-link:hover {
    color: var(--primary);
}

.sidebar-logo {
    height: 40px;
    margin-bottom: 16px;
    mix-blend-mode: multiply;
}

.sidebar-header h1 {
    font-size: 1.75rem;
    color: var(--secondary);
    margin-bottom: 8px;
}

/* Wizard Progress */
.wizard-progress {
    margin-bottom: 32px;
}

.progress-bar {
    height: 6px;
    background: #E1DFDD;
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 33%;
    background: var(--primary);
    transition: width 0.3s ease;
}

#step-indicator {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Form Steps */
.wizard-step {
    display: none;
    animation: slideIn 0.3s ease;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-desc {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* V4 Spacing Refinements & Best Practices */
.question-title {
    margin-bottom: 48px;
    /* Requirement: Option buttons closer to title? No, User said: "first option button has too less space away from the step title" -> So Increase margin. */
    /* Wait, checking user request: "too less space away from step title" -> INCREASE space. */
    /* "too large space away from next step" -> DECREASE space below options. */
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.3;
}

.radio-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Tighter gap between options */
    margin-bottom: 24px;
    /* Reduced space before validation/buttons */
}

/* Radio Card Best Practices */
.radio-card {
    display: flex;
    align-items: center;
    /* Center vertically */
    gap: 16px;
    padding: 18px 20px;
    /* More breathing room inside */
    background: white;
    border: 1px solid #E1DFDD;
    /* Subtle border */
    border-radius: 8px;
    /* Modern radius */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.radio-card:hover {
    border-color: var(--primary);
    background: #F8FDFC;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 130, 114, 0.08);
    /* Colored shadow hint */
}

.radio-card.selected {
    border-color: var(--primary);
    background: #F0F9F8;
    box-shadow: 0 0 0 1px var(--primary);
    /* Focus ring style */
}

.radio-card.selected::after {
    content: '';
    /* Changed from checkmark to simple circle or custom icon for cleaner UI, 
       but stick to checkmark if preferred. Let's use a nice SVG checkmark or similar if possible, 
       but keeping simple character for now with better positioning. */
    content: '✓';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
    font-size: 1.2rem;
    color: var(--primary);
}

.step-actions {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    /* Minimal space, as requested "too large space away from next step" -> Reduce this. */
    padding-top: 10px;
}

/* Red Text Utility */
.text-danger {
    color: #D13438;
    font-weight: 600;
}

/* Container Polish */
.architect-sidebar {
    padding: 40px;
    /* More padding container */
}


/* Result Page Overhaul - Premium Dashboard Style (V5 Fixed) */
.result-container {
    max-width: 1000px;
    margin: 0 auto;
    font-family: 'Segoe UI', 'Inter', sans-serif;
    padding-bottom: 60px;
}

.result-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E1DFDD;
}

.result-header .badge {
    background: #E6F2F0;
    /* Light teal */
    color: var(--primary-dark);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    display: inline-block;
}

.result-header h1 {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.result-header p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Dashboard Grid */
.result-grid {
    display: flex;
    flex-wrap: wrap;
    /* Robust wrapping */
    gap: 40px;
    align-items: flex-start;
}

.diagram-col {
    flex: 1;
    /* Match alignment with details col */
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #E1DFDD;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.diagram-col h3,
.details-col h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.diagram-box {
    background: #FAFAFA;
    padding: 2px;
    /* Slight border effect */
    border-radius: 8px;
    text-align: center;
    overflow: hidden;
}

.diagram-box img {
    max-width: 100%;
    max-height: 400px;
    /* Constrain height to align with bullets */
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.source-citation {
    margin-top: 12px;
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
}

/* Recommendations styled as cards */
.details-col {
    flex: 1 1 400px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rec-list li {
    background: white;
    padding: 20px;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    color: var(--secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    line-height: 1.5;
}

.rec-list li strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 4px;
    font-weight: 700;
}

.action-box {
    background: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    margin-top: 16px;
    border: 1px solid #E1DFDD;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.action-box p {
    margin-bottom: 20px;
    font-size: 1rem;
    color: var(--secondary);
    font-weight: 500;
}


/* Document View (Legacy - Hidden) */
.document-view {
    display: none !important;
}

.result-header h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.doc-body {
    font-family: 'Inter', sans-serif;
    color: var(--secondary);
    line-height: 1.6;
}

.doc-body h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 32px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.doc-body p,
.doc-body ul {
    margin-bottom: 16px;
}

.doc-body li {
    margin-bottom: 8px;
    list-style: square;
    margin-left: 20px;
}

.doc-footer {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid #E1DFDD;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .architect-container {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }

    .architect-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #E1DFDD;
    }

    .preview-header {
        display: none;
    }

    .blueprint-canvas {
        padding: 20px;
        min-height: 500px;
    }
}

/* New Enhancements */

/* Hashtags */
.hashtag-btn {
    background: white;
    border: 1px solid #E1DFDD;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.hashtag-btn:hover {
    background: rgba(0, 130, 114, 0.1);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Textarea */
.custom-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #EDEBE9;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
    min-height: 150px;
    /* Enforced height */
    transition: border-color 0.2s;
}

.custom-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 130, 114, 0.1);
}

/* Start Over Button */
.btn-ghost {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid #E1DFDD;
    /* Solid border */
    border-radius: 4px;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: #FAF9F8;
}

/* Magic Button (Generate) */
.btn-magic {
    background: linear-gradient(135deg, #008272 0%, #00B294 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 4px;
    /* Consistent with others */
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 130, 114, 0.2);
    display: inline-block;
    text-decoration: none;
}

.btn-magic:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 130, 114, 0.3);
}

/* BRD Specific Styles (V9) */

/* Keyword Highlighting */
.highlight-text {
    background-color: rgba(0, 130, 114, 0.1);
    color: var(--primary-dark);
    font-weight: 700;
    padding: 0 4px;
    border-radius: 4px;
}

/* Summary Text */
.summary-text {
    font-size: 1.15rem !important;
    line-height: 1.8 !important;
    color: #444 !important;
    max-width: 800px;
}

/* Scope/Requirement List */
.scope-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: white;
    border: 1px solid #E1DFDD;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.scope-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.scope-content {
    flex: 1;
    font-size: 1rem;
    color: var(--secondary);
    padding-right: 16px;
}

/* Delete Button */
.btn-delete {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.2s;
    padding: 4px;
    border-radius: 4px;
}

.btn-delete:hover {
    opacity: 1;
    background-color: #FFF0F0;
    transform: scale(1.1);
}

/* Contact Form */
.contact-form-box {
    background: #F8F9FA;
    border: 1px solid #E9ECEF;
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    margin-bottom: 24px;
}

.contact-form-box h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 8px;
}

.contact-form-box p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
}

.form-group input {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 130, 114, 0.1);
}

/* Section Blocks */
.section-block {
    margin-bottom: 40px;
}

.section-block h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 16px;
    border-bottom: 2px solid #E1DFDD;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Dossier Completion Score */
.dossier-score {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    letter-spacing: 0.5px;
}

.dossier-completion {
    height: 4px;
    background: #E1DFDD;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.dossier-completion-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* BRD Meta Cards (Timeline/Investment) */
.brd-meta-row {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin: -16px 0 32px;
    flex-wrap: wrap;
}

.brd-meta-card {
    background: white;
    border: 1px solid #E1DFDD;
    border-radius: 12px;
    padding: 20px 32px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

.brd-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    font-weight: 600;
}

.brd-meta-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-heading);
}

/* Next Steps */
.next-steps-list {
    list-style: none;
    counter-reset: ns-counter;
    padding: 0;
}

.next-steps-list li {
    counter-increment: ns-counter;
    background: white;
    padding: 16px 20px 16px 56px;
    border: 1px solid #E1DFDD;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--secondary);
    position: relative;
    line-height: 1.5;
}

.next-steps-list li::before {
    content: counter(ns-counter);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}