/* IFRS 9 Provision Calculator - Compact & Standardized Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Professional Financial Palette (Midnight & Slate) */
    --primary-color: #2C3E50;      /* Midnight Blue */
    --primary-dark: #1A252F;       /* Darker Charcoal */
    --secondary-color: #546E7A;    /* Slate Grey */
    --accent-color: #3498DB;       /* Trustworthy Blue */
    --dark-color: #17202A;         /* Almost Black */
    --text-main: #37474F;          /* Soft Black */
    --text-muted: #78909C;         /* Muted Slate */
    --light-bg: #F5F7FA;           /* Light Blue-Grey Background */
    --border-color: #CFD8DC;       /* Light Blue-Grey Border */
    
    /* Stage Colors (Muted for Calmness) */
    --stage1-color: #27AE60;       /* Calm Green */
    --stage2-color: #F39C12;       /* Muted Orange */
    --stage3-color: #C0392B;       /* Muted Red */

    /* Compact Spacing Constants */
    --section-pad: 60px;
    --card-pad: 1.25rem;
    --border-radius: 10px;
}

/* Base Styles */
body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-main);
    background-color: #f1f5f9;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

/* Navigation */
.navbar {
    background-color: var(--dark-color) !important;
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 60px 0 40px;
    clip-path: polygon(0 0, 100% 0, 100% 98%, 0 100%);
}

.hero-section h1 {
    font-size: 2.75rem;
    color: white;
}

/* Standardized Sections */
.section {
    padding: var(--section-pad) 0;
}

.section-title {
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

/* Compact Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    background-color: white;
}

.card-body {
    padding: var(--card-pad);
}

/* Grid Spacing */
.row {
    --bs-gutter-x: 1.25rem;
    --bs-gutter-y: 1.25rem;
}

/* Forms */
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

/* Buttons */
.btn {
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
}

/* Tables */
.table-styled th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    background-color: #f8fafc;
}

.table-styled td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Workflow Visualizer */
.bg-dark-gradient {
    background: linear-gradient(135deg, var(--dark-color) 0%, #34495E 100%);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.workflow-visualizer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    padding: 1.5rem 0;
    gap: 0;
}

.wf-step {
    flex: 0 0 170px;
    z-index: 2;
    text-align: center;
    position: relative;
}

.wf-icon {
    width: 60px;
    height: 60px;
    background: #002b5b;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: var(--accent-color);
    box-shadow: 0 0 20px rgba(87, 197, 182, 0.25);
    transition: all 0.3s ease;
}

.wf-step:hover .wf-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(87, 197, 182, 0.5);
    background: var(--accent-color);
    color: var(--dark-color);
}

.wf-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 0.75rem;
    color: white;
}

.wf-content h5 { 
    font-size: 0.9rem; 
    margin-bottom: 0.2rem; 
    color: #fff;
    font-weight: 700;
}

.wf-content p { 
    font-size: 0.7rem; 
    margin: 0; 
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}

.wf-connector {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    position: relative;
    min-width: 20px;
}

.wf-connector::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 0; height: 100%;
    background: var(--accent-color);
    animation: flowLine 3s infinite linear;
}

/* Utility Classes - Enhanced Allocation */
.bg-light-gradient {
    background: linear-gradient(180deg, var(--light-bg) 0%, #e3e8ee 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.text-primary-custom { color: var(--accent-color) !important; }
.text-secondary-custom { color: var(--secondary-color) !important; }

/* Icon Wrappers - Enhanced */
.icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.icon-wrapper.primary { 
    background: rgba(52, 152, 219, 0.1); 
    color: var(--accent-color); 
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.icon-wrapper.secondary { 
    background: rgba(84, 110, 122, 0.1); 
    color: var(--secondary-color);
    border: 1px solid rgba(84, 110, 122, 0.2);
}

.icon-wrapper.stage1 { background: rgba(39, 174, 96, 0.1); color: var(--stage1-color); }
.icon-wrapper.stage2 { background: rgba(243, 156, 18, 0.1); color: var(--stage2-color); }
.icon-wrapper.stage3 { background: rgba(192, 57, 43, 0.1); color: var(--stage3-color); }

/* Formula Box - Financial Style */
.formula-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    padding: 2rem;
    border-radius: 4px 8px 8px 4px;
    margin: 2rem 0;
    font-family: 'Inter', sans-serif;
    color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.formula-box .formula {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Progress Steps */
.progress-steps {
    margin: 1.5rem 0 2.5rem;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 18px; left: 0; right: 0; height: 3px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.progress-step .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-step.active .step-number {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.progress-step.completed .step-number {
    border-color: var(--stage1-color);
    background: var(--stage1-color);
    color: white;
}

.progress-step .step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 100px 0; /* Increased to 100px for more air */
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.page-header h1, 
.page-header h2, 
.page-header h3, 
.page-header .lead {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.page-header h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem; /* Increased margin */
    font-size: 3rem; /* Larger font */
}

.page-header .lead {
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.9;
    max-width: 800px;
}

.page-header .breadcrumb {
    background: rgba(255,255,255,0.08); /* More subtle */
    display: inline-flex;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    margin-bottom: 2rem; /* Increased spacing from title */
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.page-header .breadcrumb-item.active {
    color: white !important;
    font-weight: 700;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
    padding: 0 0.75rem;
}

/* Sidebar */
.sidebar-nav {
    padding: 1rem;
    position: sticky;
    top: 80px;
}

.sidebar-nav .nav-link {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem !important;
    color: var(--text-main);
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--light-bg);
    border-left-color: var(--secondary-color);
}

.sidebar-nav .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(26, 95, 122, 0.1);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* Result Box */
.result-box {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
    color: white;
    border-radius: var(--border-radius);
    text-align: center;
}

.result-box .result-value {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Utilities */
.mb-5 { margin-bottom: 2rem !important; }
.mt-5 { margin-top: 2rem !important; }
.py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }

/* Scroll Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Stats Strip */
.stats-strip {
    background: white;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    position: relative;
    z-index: 10;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-text h6 { margin: 0; font-size: 0.9rem; color: var(--dark-color); }
.stat-text p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* Responsive adjustments */
@media (max-width: 991px) {
    .workflow-visualizer { gap: 1rem; flex-direction: column; align-items: center; }
    .wf-connector { height: 30px; margin: 0; width: 2px; }
    .wf-connector::after { height: 0; width: 100%; top: 0; animation: flowLineVertical 3s infinite linear; }
    .hero-section h1 { font-size: 2rem; }
}

@keyframes flowLineVertical {
    0% { height: 0; top: 0; opacity: 0; }
    50% { height: 100%; top: 0; opacity: 1; }
    100% { height: 0; top: 100%; opacity: 0; }
}

/* Print Styles */
@media print {
    .navbar, .footer, .sidebar-nav, .btn { display: none !important; }
    .page-header { background: none !important; color: black !important; padding: 20px 0 !important; }
    .section { padding: 20px 0 !important; }
}
