/* ==========================================================================
   Calculator Cod Penal - Poliția Română
   Design System & Styling
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #0a0e17;
    --bg-card: #121824;
    --bg-card-hover: #1a2334;
    --bg-glass: rgba(18, 24, 36, 0.75);
    --bg-input: #161f30;
    
    --accent-blue: #2563eb;
    --accent-blue-light: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-gold: #f59e0b;
    --accent-gold-dark: #d97706;
    --accent-red: #ef4444;
    --accent-green: #10b981;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(59, 130, 246, 0.3);

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-sub: #6b7280;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.2);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 40%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* Layout Container */
.app-container {
    max-width: 1560px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.app-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-main);
    position: relative;
}

.header-banner {
    position: relative;
    height: 140px;
    width: 100%;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.65) contrast(1.1);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(10, 14, 23, 0.2) 0%, rgba(18, 24, 36, 0.95) 100%);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px 20px;
    margin-top: -45px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    gap: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue-light);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 25px;
    align-items: start;
}

/* Catalog Section */
.catalog-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Search Box Container */
.search-box-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-main);
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

#searchInput {
    width: 100%;
    padding: 14px 45px 14px 46px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 15px;
    font-family: var(--font-main);
    transition: all 0.2s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.clear-search-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.clear-search-btn:hover {
    color: var(--accent-red);
}

/* Filter Chips Scroll */
.filters-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filters-scroll::-webkit-scrollbar {
    height: 4px;
}

.filters-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.filter-chip {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.filter-chip.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
    border-color: var(--accent-blue-light);
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Articles Container & Cards */
.articles-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.chapter-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-main);
}

.chapter-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.subcategory-group {
    margin-top: 15px;
}

.subcategory-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Article Card */
.article-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    transition: all 0.2s ease;
    position: relative;
}

.article-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(59, 130, 246, 0.3);
}

.article-card.selected {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(18, 24, 36, 0.9) 100%);
    border-color: var(--accent-blue-light);
    box-shadow: inset 0 0 15px rgba(37, 99, 235, 0.1);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.article-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    cursor: pointer;
}

.article-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-blue-light);
    margin-top: 2px;
    cursor: pointer;
}

.article-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.article-art-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.article-title-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.article-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-penalty {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}

.badge-fine {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-jail {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Article Extra Controls & Options */
.article-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-explanation {
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-cyan);
}

.options-selector-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.options-selector-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.select-variant {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font-main);
}

.select-variant:focus {
    outline: none;
    border-color: var(--accent-blue-light);
}

/* Custom Checkboxes */
.custom-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.custom-checkbox .checkbox-box {
    width: 100%;
    height: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border-glow);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 11px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.custom-checkbox input[type="checkbox"]:hover + .checkbox-box {
    border-color: var(--accent-blue-light);
    transform: scale(1.08);
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-box {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    border-color: var(--accent-cyan);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
    transform: scale(1.05);
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-box.purple {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.card-toggles-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card-toggles-row .complicity-wrapper,
.card-toggles-row .exception-wrapper {
    flex: 1;
    min-width: 220px;
}

.complicity-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    background: rgba(245, 158, 11, 0.05);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(245, 158, 11, 0.15);
    transition: all 0.2s ease;
}

.complicity-wrapper:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.complicity-text strong {
    color: var(--accent-gold);
}

.exception-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    background: rgba(168, 85, 247, 0.05);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(168, 85, 247, 0.15);
    transition: all 0.2s ease;
}

.exception-wrapper:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
}

.exception-text strong {
    color: #c084fc;
}

.selected-item-row.item-exception {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.08);
}

.selected-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-exception-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-exception-toggle:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
}

.btn-exception-toggle.active {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

/* Sticky Calculator Drawer */
.calculator-aside {
    position: sticky;
    top: 20px;
}

.calculator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.calc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-cyan);
}

.calc-title h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.count-badge {
    background: var(--accent-blue);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

/* Toggles */
.rules-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.toggle-control {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
}

.toggle-control input {
    display: none;
}

.toggle-slider {
    width: 32px;
    height: 18px;
    background: #374151;
    border-radius: 20px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s ease;
}

.toggle-control input:checked + .toggle-slider {
    background: var(--accent-blue-light);
}

.toggle-control input:checked + .toggle-slider::before {
    transform: translateX(14px);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Selected List */
.selected-items-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.selected-items-list::-webkit-scrollbar {
    width: 5px;
}

.selected-items-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 25px 10px;
    color: var(--text-sub);
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.selected-item-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 8px;
}

.selected-item-info {
    display: flex;
    flex-direction: column;
}

.selected-item-title {
    font-weight: 600;
    color: var(--text-main);
}

.selected-item-sub {
    font-size: 11px;
    color: var(--accent-gold);
}

.selected-item-vals {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-item-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.remove-item-btn:hover {
    color: var(--accent-red);
}

/* Summary Box */
.calc-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.summary-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.summary-value {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    margin-top: 2px;
}

.summary-value.green {
    color: #34d399;
}

.summary-value.yellow {
    color: #fbbf24;
}

.summary-sub {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 2px;
}

.extra-sanctions-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 12px;
}

.extra-title {
    font-weight: 700;
    color: #fca5a5;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.extra-list {
    padding-left: 18px;
    color: var(--text-muted);
}

/* Suspect Form */
.suspect-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 13px;
    font-family: var(--font-main);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue-light);
}

/* Modal Overlay & Card */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.modal-lg {
    max-width: 750px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rule-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 14px;
}

.rule-icon {
    font-size: 20px;
    color: var(--accent-cyan);
}

.rule-block h4 {
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.rule-block p {
    font-size: 13px;
    color: var(--text-muted);
}

.rule-block small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-sub);
}

.report-preview-box {
    background: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.report-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #38bdf8;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-blue);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive Breakdown */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .calculator-aside {
        position: static;
    }
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions button {
        flex: 1;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .app-header, .search-box-container, .calculator-aside, .modal-footer, .modal-close {
        display: none !important;
    }

    .modal-overlay {
        position: static;
        background: white;
        padding: 0;
    }

    .modal-card {
        border: none;
        box-shadow: none;
        max-width: 100%;
    }

    .report-code {
        color: black;
    }
}

/* ==========================================================================
   Iframe & Embedded Tablet / FiveM NUI Compatibility Mode
   ========================================================================== */
body.in-iframe {
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
}

body.in-iframe .app-container {
    height: 100vh;
    max-height: 100vh;
    padding: 12px;
    gap: 12px;
    overflow: hidden;
}

body.in-iframe .main-layout {
    height: calc(100vh - 120px);
    overflow: hidden;
}

body.in-iframe .catalog-section {
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
}

body.in-iframe .calculator-aside {
    height: 100%;
    overflow-y: auto;
    position: static;
}

body.in-iframe .catalog-section::-webkit-scrollbar,
body.in-iframe .calculator-aside::-webkit-scrollbar {
    width: 5px;
}

body.in-iframe .catalog-section::-webkit-scrollbar-thumb,
body.in-iframe .calculator-aside::-webkit-scrollbar-thumb {
    background: var(--border-glow);
    border-radius: 4px;
}

body.in-iframe .header-banner {
    height: 80px;
}

body.in-iframe .header-content {
    padding: 8px 18px;
    margin-top: -35px;
}

body.in-iframe .badge-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
}

body.in-iframe .brand-title {
    font-size: 20px;
}

