/* HOST V1 - CISA House Style Layout */
/* Complete layout styling for HOST V1 application */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #212529;
    background-color: #ffffff;
}

/* CISA Color Palette */
:root {
    --primary-blue: #1a365d;
    --secondary-blue: #2c5282;
    --accent-blue: #3182ce;
    --light-blue: #ebf8ff;
    --success-green: #38a169;
    --warning-orange: #ed8936;
    --danger-red: #e53e3e;
    --neutral-gray: #718096;
    --light-gray: #f7fafc;
    --border-gray: #e2e8f0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Layout Container */
.container {
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header, .site-security-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)) !important;
    color: white !important;
    padding: 2rem 0 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    width: 100% !important;
    position: relative !important;
    z-index: 10 !important;
}

.header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-text h1 {
    color: white !important;
    margin: 0 !important;
    font-size: 2rem !important;
}

.header-text p {
    color: #e2e8f0 !important;
    margin: 0 !important;
    font-size: 1rem !important;
}

.assessment-info {
    color: white !important;
}

.assessment-info p {
    color: white !important;
    margin: 0.25rem 0 !important;
}

.assessment-info strong {
    color: white !important;
    font-weight: 600 !important;
}

/* Ensure header is visible */
.site-security-header {
    background: linear-gradient(135deg, #1a365d, #2c5282) !important;
    color: white !important;
    padding: 2rem 0 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    width: 100% !important;
    position: relative !important;
    z-index: 10 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.site-security-header .header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 2rem !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
}

.site-security-header .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 2rem !important;
    flex: 1 !important;
}

.site-security-header .header-right {
    display: flex !important;
    align-items: center !important;
}

.site-security-header .logo-text h1 {
    color: white !important;
    margin: 0 !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
}

.site-security-header .logo-text p {
    color: #e2e8f0 !important;
    margin: 0 !important;
    font-size: 1rem !important;
}

.site-security-header .assessment-info {
    color: white !important;
    text-align: right !important;
}

.site-security-header .assessment-info p {
    color: white !important;
    margin: 0.25rem 0 !important;
    font-size: 0.9rem !important;
}

.site-security-header .assessment-info strong {
    color: white !important;
    font-weight: 600 !important;
}

.site-security-header .auto-save-status {
    color: #e2e8f0 !important;
    font-size: 0.8rem !important;
    font-style: italic !important;
}


/* Progress Section */
.progress-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
}

/* Assessment Progress - Sticky positioning */
.assessment-progress {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: white;
    border-bottom: 2px solid var(--border-gray);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Return to Top Button */
.return-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: none;
}

.return-to-top-btn:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.return-to-top-btn.show {
    display: flex;
    align-items: center;
    justify-content: center;
}





.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.progress-percentage {
    background: var(--accent-blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--success-green));
    transition: width 0.3s ease;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.step.completed {
    background: var(--light-blue);
    color: var(--primary-blue);
}

.step.current {
    background: var(--accent-blue);
    color: white;
}

.step.pending {
    background: #f7fafc;
    color: var(--neutral-gray);
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step.completed .step-number {
    background: var(--success-green);
    color: white;
}

.step.current .step-number {
    background: white;
    color: var(--accent-blue);
}

.step.pending .step-number {
    background: var(--neutral-gray);
    color: white;
}

/* Main Content */
.main-content {
    margin-bottom: 0.5rem;
    margin-top: 0 !important;
    padding-top: 0.25rem;
}

.content-area {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Sections */
.section {
    margin-bottom: 1rem;
}

.section-header {
    border-bottom: 3px solid var(--accent-blue);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.875rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.section-description {
    color: var(--neutral-gray);
    font-size: 1rem;
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 0.5rem;
}

.card {
    background: white;
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-gray);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
}

.card-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-blue);
}

/* Forms */
.form-group {
    margin-bottom: 0.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 0.5rem 0;
    border-radius: 8px;
    border: 1px solid var(--border-gray);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: var(--light-blue);
    color: var(--primary-blue);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--accent-blue);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-gray);
    vertical-align: top;
}

.data-table tr:hover {
    background: var(--light-gray);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-blue);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--neutral-gray);
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-danger {
    background: var(--danger-red);
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-info {
    background: var(--light-blue);
    color: var(--primary-blue);
    border-left: 4px solid var(--accent-blue);
}

.alert-warning {
    background: #fef5e7;
    color: #744210;
    border-left: 4px solid var(--warning-orange);
}

.alert-success {
    background: #f0fff4;
    color: var(--success-green);
    border-left: 4px solid var(--success-green);
}

/* Data Management Panel */
.data-management {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-blue);
    color: white;
    border-radius: 12px;
    padding: 0.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    max-height: 200px;
}

.data-management.collapsed {
    transform: translateY(calc(100% - 60px));
}

.data-management-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.data-management-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.data-management-content {
    display: grid;
    gap: 0.25rem;
}

.data-management.collapsed .data-management-content {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Fix gaps on pages 2-8 by targeting specific elements */
.section .alert {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

.section .question-item {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

.section .question-item:first-child {
    margin-top: 0 !important;
}

/* Remove any default margins from form elements in sections */
.section .form-row,
.section .form-group,
.section .card,
.section .card-body {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

/* Ensure consistent spacing for all content in sections 2-8 */
.section > *:first-child {
    margin-top: 0 !important;
}

.section > *:last-child {
    margin-bottom: 0 !important;
}
