:root {
    --color-dark-blue: #004680;
    --color-primary: #0071A4;
    --color-secondary: #009AAD;
    --color-ternary: #00C09C;
    --color-light: #87E17F;
    --color-yellow: #F9F871;
    --color-purple: #7561AA;

    --bg-color: #f8fbff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 70, 128, 0.15);
    
    --primary-color: var(--color-primary);
    --primary-hover: var(--color-secondary);
    
    --text-main: var(--color-dark-blue);
    --text-muted: #4a6a8a;
    
    --accent-color: var(--color-ternary);
    
    --input-bg: #ffffff;
    --ignored-color: var(--color-purple);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(135, 225, 127, 0.2), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(249, 248, 113, 0.2), transparent 25%),
        radial-gradient(circle at 50% 80%, rgba(0, 154, 173, 0.15), transparent 40%);
    overflow-x: hidden;
}

.app-container {
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    gap: 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 70, 128, 0.08);
}

/* Sidebar */
.sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    padding: 25px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--glass-bg), rgba(255,255,255,0.95));
}

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

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

.logo-icon {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 113, 164, 0.3);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

#sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 10px;
}

#sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

#sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 70, 128, 0.1);
    border-radius: 10px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-align: left;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(0, 113, 164, 0.05);
    color: var(--color-primary);
    transform: translateX(4px);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(0, 113, 164, 0.1), transparent);
    color: var(--color-dark-blue);
    border-left: 4px solid var(--color-primary);
    font-weight: 700;
}

.nav-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 70, 128, 0.15);
}

.nav-status.done {
    background: var(--color-ternary);
    box-shadow: 0 0 10px rgba(0, 192, 156, 0.5);
}

.sidebar-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.progress-container {
    margin-bottom: 15px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(0, 70, 128, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-ternary));
    border-radius: 10px;
    transition: width 0.5s ease;
}

#progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-dark-blue);
}

.export-btn {
    width: 100%;
    padding: 12px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 113, 164, 0.25);
}

.export-btn:hover {
    background: var(--color-dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 70, 128, 0.3);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Prevents flexbox children from pushing the width out of bounds horizontally */
}

.topbar {
    padding: 0 10px;
}

.topbar h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-dark-blue);
}

.content-wrapper {
    flex-grow: 1;
    padding: 35px;
    overflow-y: auto;
    overflow-x: hidden; /* Contains horizontal overflow */
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: #ffffff;
    min-width: 0;
}

.content-wrapper > * {
    flex-shrink: 0;
}

.content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 70, 128, 0.15);
    border-radius: 10px;
}

/* Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    background: var(--input-bg);
    border: 1px solid rgba(0, 70, 128, 0.2);
    padding: 15px;
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 164, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Checklist Details */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

/* Requirement Block */
.requirement-block {
    display: flex;
    flex-direction: column;
    background: #fafcfd;
    border-radius: 12px;
    border: 1px solid rgba(0, 70, 128, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.check-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    cursor: pointer;
}

.requirement-block:hover {
    background: #f0f6fa;
    border-color: rgba(0, 113, 164, 0.3);
}

.requirement-block.checked {
    background: rgba(0, 192, 156, 0.05); /* Ternary tint */
    border-color: rgba(0, 192, 156, 0.4);
}

.requirement-block.ignored {
    background: #f2f2f2;
    border-color: rgba(117, 97, 170, 0.3); /* Purple context */
    opacity: 0.8;
}

.check-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(0, 70, 128, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: #fff;
}

.requirement-block.checked .check-box {
    background: var(--color-ternary);
    border-color: var(--color-ternary);
}

.check-box::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.requirement-block.checked .check-box::after {
    opacity: 1;
}

.check-text {
    font-size: 0.95rem;
    line-height: 1.5;
    user-select: none;
    flex-grow: 1;
    color: var(--text-main);
    font-weight: 500;
}

.requirement-block.checked .check-text {
    color: var(--color-ternary);
    text-decoration: line-through;
}

.requirement-block.ignored .check-text {
    text-decoration: line-through;
    color: var(--color-purple);
}

.requirement-block.ignored .check-box {
    border-color: var(--color-purple);
    background: rgba(117, 97, 170, 0.1);
}
.requirement-block.ignored .check-box::after {
    opacity: 0;
}

/* Actions Container */
.check-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Help Button */
.help-btn {
    background: #fff;
    border: 1px solid rgba(0, 70, 128, 0.2);
    color: var(--color-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.help-btn:hover, .help-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Ignore Button */
.ignore-btn {
    background: #fff;
    border: 1px solid rgba(0, 70, 128, 0.2);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ignore-btn:hover {
    background: rgba(0, 113, 164, 0.05);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.ignore-btn.active {
    background: var(--color-purple);
    color: #fff;
    border-color: var(--color-purple);
}

/* Help Block Info */
.help-block {
    margin: 0 20px 15px 54px;
    padding: 12px 15px;
    background: rgba(0, 113, 164, 0.06);
    border-left: 3px solid var(--color-primary);
    border-radius: 4px 8px 8px 4px;
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.5;
}

/* Nested Fields */
.check-item-fields {
    padding: 0 20px 20px 54px; /* Matches checkbox width (24) + gap (15) + padding (15) */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field-inline label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.field-inline .field-control {
    padding: 10px 15px;
    font-size: 0.9rem;
    background: #fff;
    border-color: rgba(0, 70, 128, 0.15);
}

.requirement-block.ignored .check-item-fields {
    opacity: 0.4;
    pointer-events: none;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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

/* Upload area */
.upload-area {
    border: 2px dashed rgba(0, 70, 128, 0.25);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fbff;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--color-primary);
    background: rgba(0, 113, 164, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--color-primary);
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 10px;
}

.upload-btn {
    background: var(--color-secondary);
    border: none;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}
.upload-btn:hover {
    background: var(--color-primary);
    transform: translateY(-2px);
}
