:root {
    --fsu-blue: #003D79;
    --fsu-blue-light: #0056b3;
    --fsu-gray: #f4f5f7;
    --fsu-gray-dark: #6c757d;
    --fsu-white: #ffffff;
    --fsu-red: #dc3545;
    --fsu-green: #28a745;
    --fsu-yellow: #ffc107;
}

/* Dark Mode */
[data-theme="dark"] {
    --fsu-gray: #1a1d23;
    --fsu-white: #23272e;
    --fsu-gray-dark: #adb5bd;
    color: #e0e0e0;
}

[data-theme="dark"] body {
    background: #1a1d23;
    color: #e0e0e0;
}

[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .dim-item,
[data-theme="dark"] .report-panel {
    background: #23272e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-control {
    background: #2c313a;
    border-color: #3d4450;
    color: #e0e0e0;
}

[data-theme="dark"] .form-control:focus {
    border-color: #4d9fff;
    box-shadow: 0 0 0 2px rgba(77, 159, 255, 0.2);
}

[data-theme="dark"] .table {
    background: #23272e;
}

[data-theme="dark"] .table th {
    background: #003060;
}

[data-theme="dark"] .table td {
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .table tr:hover {
    background: #2c313a;
}

[data-theme="dark"] .report-panel-body {
    background: #23272e;
    color: #e0e0e0;
}

[data-theme="dark"] .choice-btn {
    background: #2c313a;
    border-color: #3d4450;
    color: #e0e0e0;
}

[data-theme="dark"] .choice-btn:hover {
    border-color: #4d9fff;
    background: #2f3844;
}

[data-theme="dark"] .choice-btn.selected-a,
[data-theme="dark"] .choice-btn.selected-b {
    background: #003D79;
    border-color: #4d9fff;
    color: #fff;
}

[data-theme="dark"] .resize-handle {
    background: #3d4450;
}

[data-theme="dark"] .progress-bar-container {
    background: #3d4450;
}

[data-theme="dark"] .alert-error {
    background: #3b1c22;
    color: #f5a0a8;
    border-color: #5c2a30;
}

[data-theme="dark"] .alert-success {
    background: #1c3b26;
    color: #a0f5b5;
    border-color: #2a5c36;
}

[data-theme="dark"] .alert-info {
    background: #1c2e3b;
    color: #a0d8f5;
    border-color: #2a4a5c;
}

[data-theme="dark"] .dim-name {
    color: #7db4e8;
}

[data-theme="dark"] .card-header {
    color: #7db4e8;
}

[data-theme="dark"] .navbar-brand span {
    color: var(--fsu-white);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--fsu-gray);
    color: #333;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: var(--fsu-blue);
    color: var(--fsu-white);
    padding: 0.75rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fsu-white);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.navbar-nav {
    display: flex;
    gap: 1rem;
    list-style: none;
    align-items: center;
    justify-content: flex-end;
}

.navbar-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--fsu-white);
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

.container-wide {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.container-narrow {
    max-width: 480px;
    margin: 2rem auto;
    padding: 1.5rem;
}

/* Cards */
.card {
    background: var(--fsu-white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--fsu-blue);
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--fsu-blue);
    box-shadow: 0 0 0 2px rgba(0, 61, 121, 0.15);
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
    text-align: center;
}

.btn:hover {
    opacity: 0.9;
}

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

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

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

.btn-success {
    background: var(--fsu-green);
    color: var(--fsu-white);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--fsu-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.table th {
    background: var(--fsu-blue);
    color: var(--fsu-white);
    font-weight: 500;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Progress Bar */
.progress-bar-container {
    background: #e9ecef;
    border-radius: 4px;
    height: 24px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar {
    background: var(--fsu-blue);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fsu-white);
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 2rem;
}

/* Comparison Layout - Resizable */
.comparison-resizable {
    display: flex;
    width: 100%;
    margin-bottom: 1.5rem;
    gap: 0;
    min-height: 400px;
}

.comparison-resizable .report-panel {
    flex: 1;
    background: var(--fsu-white);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.report-panel-header {
    background: var(--fsu-blue);
    color: var(--fsu-white);
    padding: 0.6rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.report-panel-body {
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-wrap;
    flex: 1;
    resize: vertical;
    min-height: 300px;
    max-height: 70vh;
}

.resize-handle {
    width: 8px;
    cursor: col-resize;
    background: #e9ecef;
    border-radius: 4px;
    margin: 0 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.resize-handle:hover,
.resize-handle.active {
    background: var(--fsu-blue);
}

/* Compact Dimension Grid */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.dim-item {
    background: var(--fsu-white);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    padding: 0.6rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dim-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dim-name {
    font-weight: 600;
    color: var(--fsu-blue);
    font-size: 0.8rem;
    line-height: 1.2;
}

.dim-info-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--fsu-blue);
    background: transparent;
    color: var(--fsu-blue);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: help;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.dim-info-btn:hover {
    background: var(--fsu-blue);
    color: var(--fsu-white);
}

.dim-info-btn:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    white-space: normal;
    width: 250px;
    max-width: 300px;
    line-height: 1.4;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
}

.dim-info-btn:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 100;
    pointer-events: none;
}

/* Font controls */
.font-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.85);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.7);
}

.dim-choices {
    display: flex;
    gap: 0.4rem;
}

.choice-btn {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background: var(--fsu-white);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s;
    text-align: center;
    color: #555;
}

.choice-btn:hover {
    border-color: var(--fsu-blue);
    background: #f0f4f8;
}

.choice-btn.selected-a {
    background: var(--fsu-blue);
    border-color: var(--fsu-blue);
    color: var(--fsu-white);
}

.choice-btn.selected-b {
    background: var(--fsu-blue);
    border-color: var(--fsu-blue);
    color: var(--fsu-white);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--fsu-white);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--fsu-blue);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--fsu-gray-dark);
    margin-top: 0.25rem;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

@media (max-width: 768px) {
    .comparison-resizable {
        flex-direction: column;
    }
    .resize-handle {
        width: 100%;
        height: 8px;
        cursor: row-resize;
        margin: 4px 0;
    }
    .dimensions-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
