body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.hero-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid #e2e8f0;
}

.ai-badge {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff8e6 100%);
    border: 1px solid #e2c97e;
}

.engine-option {
    cursor: pointer;
    transition: all 0.15s ease;
}

.engine-option:hover {
    background: #f0f4ff;
    border-color: #0d6efd !important;
}

.engine-option:has(input:checked) {
    background: #e8f0ff;
    border-color: #0d6efd !important;
}

.cursor-pointer {
    cursor: pointer;
}

.navbar-brand {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.drop-zone {
    border: 2px dashed #0d6efd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9ff;
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #0a58ca;
    background: #e8eeff;
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.15);
}

.drop-zone-content {
    pointer-events: none;
}

.code-container {
    height: 450px;
    overflow: auto;
    background: #2d2d2d;
}

.modal-code-container {
    height: 400px;
}

.code-container pre {
    margin: 0;
    min-height: 100%;
    background: #2d2d2d !important;
}

.code-container code {
    font-family: 'Cascadia Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    white-space: pre;
    display: block;
    padding: 1rem;
}

.code-panel-header {
    border-bottom: 1px solid #dee2e6;
}

.progress {
    border-radius: 10px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.4s ease;
}

.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.table > :not(caption) > * > * {
    padding: 0.6rem 0.75rem;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
}

.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.navbar {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#convert-btn:not(:disabled) {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    transition: all 0.2s;
}

#convert-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
}

.token.comment { color: #7c8dad !important; }
.token.keyword { color: #cc99cd !important; }
.token.string { color: #7ec699 !important; }
.token.number { color: #f08d49 !important; }
.token.class-name { color: #67cdcc !important; }

.bg-danger-subtle { background-color: #fff0f0; }
.bg-warning-subtle { background-color: #fffbe6; }

.line-numbers {
    counter-reset: line;
}

.line-numbers .line {
    counter-increment: line;
    display: flex;
}

.line-numbers .line::before {
    content: counter(line);
    min-width: 3ch;
    display: inline-block;
    color: #666;
    margin-right: 1rem;
    user-select: none;
    text-align: right;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .code-container {
        height: 300px;
    }
    #code-view-split .col-6 {
        min-width: 100%;
    }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

#empty-state {
    animation: fadeIn 0.5s ease;
}

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

#result-section {
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.file-list-item {
    font-size: 0.85rem;
    transition: background 0.15s;
}

.file-list-item:hover {
    background: #f8f9ff !important;
}

.file-status-badge {
    font-size: 0.68rem;
    flex-shrink: 0;
}

.diagram-panel {
    min-height: 420px;
    background: #fafbff;
}

.diagram-render-container {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    min-height: 300px;
    overflow: auto;
}

.mermaid-svg-wrapper {
    display: flex;
    justify-content: center;
}

.mermaid-svg-wrapper svg {
    max-width: 100%;
    height: auto;
}

#result-tabs-nav .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

#result-tabs-nav .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px 6px 0 0;
}

#result-tabs-nav .nav-link.active {
    font-weight: 600;
    background: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

.docs-panel {
    min-height: 420px;
    background: #fafbff;
    overflow-y: auto;
    max-height: 700px;
}

.docs-section {
    padding: 0.25rem 0;
}

.docs-section-header {
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f2f5;
    margin-bottom: 1rem;
}

.docs-table {
    font-size: 0.875rem;
}

.docs-table th {
    font-weight: 600;
    background: #f8f9fa;
    white-space: nowrap;
}

.docs-divider {
    border-color: #e9ecef;
    margin: 1.5rem 0;
}

/* ── Statistics Dashboard Cards ── */
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    text-align: center;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    height: 100%;
}

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

.stat-card--blue  { border-top: 3px solid #0d6efd; }
.stat-card--red   { border-top: 3px solid #dc3545; }
.stat-card--yellow{ border-top: 3px solid #ffc107; }
.stat-card--green { border-top: 3px solid #198754; }
.stat-card--purple{ border-top: 3px solid #6f42c1; }

.stat-card__icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-card__value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.stat-card__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    white-space: nowrap;
}

@media print {
    nav, .card-header .btn-group, #convert-btn, .btn, .hero-section { display: none !important; }
    .docs-panel { max-height: none !important; overflow: visible !important; }
    .card { box-shadow: none !important; border: none !important; }
}
