:root {
    --bg-dark: #090d16;
    --card-bg: rgba(20, 27, 45, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-glow: rgba(6, 182, 212, 0.05);
    
    --color-primary: #06b6d4;      /* Cyan */
    --color-secondary: #3b82f6;    /* Blue */
    --color-success: #10b981;      /* Emerald */
    --color-warning: #f59e0b;      /* Amber */
    --color-danger: #ef4444;       /* Coral Red */
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #475569;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --transition-speed: 0.3s;
    --border-radius: 16px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Glowing Background */
.glow-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.07) 0%, rgba(59, 130, 246, 0.03) 50%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Header Warning Countdown */
.countdown-banner {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.08) 50%, rgba(239, 68, 68, 0.15) 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.25);
    padding: 10px 20px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
}

.warning-badge {
    background: var(--color-danger);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.warning-badge i {
    width: 14px;
    height: 14px;
}

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

.time-block {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: monospace;
}

.time-block strong {
    color: var(--color-warning);
}

/* App Layout */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 45px);
    max-width: 1600px;
    margin: 0 auto;
}

/* Sidebar Styling */
.sidebar {
    background: rgba(10, 15, 30, 0.8);
    border-right: 1px solid var(--card-border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(15px);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.logo-icon i {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-area h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 550;
    text-align: left;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-speed);
}

.nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
    color: white;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-left: 3px solid var(--color-primary);
    padding-left: 13px;
}

.nav-btn i {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    margin-top: 40px;
}

.fine-card {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    padding: 15px;
}

.fine-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-danger);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.fine-header i {
    width: 14px;
    height: 14px;
}

.fine-amount {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.fine-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Content Area */
.content-area {
    padding: 40px;
    overflow-y: auto;
    max-height: calc(100vh - 45px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

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

/* Welcome Banner */
.welcome-banner {
    margin-bottom: 30px;
}

.welcome-text h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 800px;
    line-height: 1.5;
}

/* Layout Grid */
.grid-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    margin-bottom: 35px;
}

/* Card General Design */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    transition: border-color var(--transition-speed);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* Input Form & Buttons */
.scan-form {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.input-wrapper {
    position: relative;
    flex-grow: 1;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 15px 16px 45px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.btn {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* Presets */
.presets-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.presets-container span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.presets-buttons {
    display: flex;
    gap: 10px;
}

.preset-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Progress Section */
.progress-card {
    margin-top: 25px;
    border-color: rgba(6, 182, 212, 0.2);
}

.progress-bar-container {
    background: rgba(0, 0, 0, 0.4);
    height: 8px;
    border-radius: 4px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.step-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step-item {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: color 0.3s;
}

.step-item.active {
    color: var(--color-primary);
    font-weight: 550;
}

.step-item.completed {
    color: var(--color-success);
}

.step-status {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.step-item.active .step-status {
    animation: rotate 2s linear infinite;
    color: var(--color-primary);
}

.step-item.completed .step-status {
    color: var(--color-success);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Info Welcome / Empty State Card */
.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    min-height: 380px;
    border-style: dashed;
}

.info-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: var(--color-secondary);
}

.info-icon i {
    width: 35px;
    height: 35px;
}

.info-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 25px;
    max-width: 450px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.info-item i {
    width: 18px;
    height: 18px;
}

/* Results Dashboard Card */
.results-card {
    border-color: rgba(6, 182, 212, 0.15);
}

.results-summary-row {
    display: flex;
    align-items: center;
    gap: 30px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 25px;
    margin-bottom: 25px;
}

/* Circular Progress Score */
.score-circle-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-svg {
    transform: rotate(-90deg);
    width: 120px;
    height: 120px;
}

.score-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.score-circle-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out, stroke 0.5s;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
}

.score-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-info h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.scan-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-badge.compliant {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Score Stats Grid */
.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Detailed Report Card */
.report-detail-card {
    margin-top: 30px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.report-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Tabs */
.tabs-container {
    margin-bottom: 30px;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--card-border);
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-speed);
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.pane-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.pane-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.pane-header h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 4px;
}

.pane-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Tables Styling */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 14px 18px;
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    line-height: 1.4;
}

tr:last-child td {
    border-bottom: none;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-status.success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
}

.badge-status.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
}

.badge-status.danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
}

/* Headers status grid */
.headers-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.header-status-item {
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
}

.header-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.header-val {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Recommendations and Actions Requeridas */
.recommendations-box {
    margin-top: 30px;
    border-top: 1px solid var(--card-border);
    padding-top: 25px;
}

.recommendations-box h3 {
    margin-bottom: 18px;
    color: var(--text-main);
}

.rec-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: 10px;
    align-items: flex-start;
}

.rec-item-points {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rec-item-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.rec-item-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.banner-status-box {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Form Groups and Custom Control */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

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

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Textarea / Output area */
.result-text-area {
    margin-top: 25px;
    border-top: 1px solid var(--card-border);
    padding-top: 20px;
    animation: fadeIn 0.3s;
}

.textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.textarea-header span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-text-area textarea {
    width: 100%;
    background: #050811;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #38bdf8;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    padding: 15px;
    resize: none;
}

.result-text-area pre {
    max-height: 250px;
    overflow-y: auto;
    background: #050811;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 15px;
}

.result-text-area code {
    color: #38bdf8;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
}

/* Law Guide articles */
.law-articles {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    border-left: 4px solid var(--color-primary);
}

.article-badge {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--color-primary);
}

.article-card h3 {
    margin-bottom: 12px;
}

.article-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.article-card ul {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.article-card li {
    font-size: 0.9rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 20px;
}

.article-card li::before {
    content: "•";
    color: var(--color-primary);
    position: absolute;
    left: 5px;
    font-size: 1.2rem;
}

.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-primary { color: var(--color-primary) !important; }

.hidden {
    display: none !important;
}

/* Printing styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .countdown-banner, .sidebar, .glow-bg, .scan-card, .progress-card, .info-card {
        display: none !important;
    }
    
    .app-layout {
        display: block;
    }
    
    .content-area {
        padding: 0;
        max-height: none;
        overflow: visible;
    }
    
    .card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        margin-bottom: 30px;
    }
    
    .results-summary-row {
        border-bottom: 2px solid #333;
        padding-bottom: 15px;
    }
    
    .score-circle-bg {
        stroke: #eee;
    }
    
    .score-circle-fill {
        stroke: #333 !important;
    }
    
    .tab-pane {
        display: block !important;
        margin-bottom: 40px;
    }
    
    .tabs-header {
        display: none !important;
    }
    
    th {
        background: #f1f1f1 !important;
        color: black !important;
        border-bottom: 2px solid #ccc;
    }
    
    td {
        color: black !important;
        border-bottom: 1px solid #eee;
    }
}

/* Mobile responsive styles */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
    
    .grid-layout {
        grid-template-columns: 1fr;
    }
}
