/* KGL Foundation Legacy Fund Portal - Modern UI/UX */

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

:root {
    /* Modern Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #6c757d;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows - Reduced for subtler UI */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* Cards */
.card {
    border: none;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    color: var(--gray-800);
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(102, 126, 234, 0.15);
}

.required-field::after {
    content: " *";
    color: var(--danger-color);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
}

/* Tables */
.table th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Dashboard Stats */
.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
}

/* Document Upload */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: var(--success-color);
    background-color: #d1e7dd;
}

.file-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.file-list-item .file-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.file-list-item .file-info {
    flex: 1;
}

.file-list-item .file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.file-list-item .file-size {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 3.5rem;
    margin: 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #0d6efd 0%, #dee2e6 100%);
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    min-height: 80px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -3.5rem;
    top: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.timeline-content {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.timeline-content:hover {
    box-shadow: var(--shadow);
    transform: translateX(2px);
}

.timeline-header {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.timeline-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-item.completed .timeline-marker {
    background-color: var(--success-color);
}

.timeline-item.pending .timeline-marker {
    background-color: var(--warning-color);
}

.timeline-item.declined .timeline-marker {
    background-color: var(--danger-color);
}

/* Responsive timeline */
@media (max-width: 768px) {
    .timeline {
        padding-left: 2.5rem;
    }
    
    .timeline-marker {
        width: 28px;
        height: 28px;
        left: -2.7rem;
        font-size: 0.8rem;
    }
    
    .timeline::before {
        left: 0.5rem;
    }
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 10px;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
}

/* Progress Bar */
.progress {
    height: 1.5rem;
    border-radius: 8px;
}

.progress-bar {
    font-weight: 600;
}

/* Utility Classes */
.text-primary-hover:hover {
    color: var(--primary-color) !important;
}

.shadow-sm-hover:hover {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-number {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
        page-break-inside: avoid;
    }
    
    h2, h3, h4, h5 {
        color: #000 !important;
        page-break-after: avoid;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }
    
    .badge {
        border: 1px solid #dee2e6;
        color: #000 !important;
    }
    
    /* Add print header */
    @page {
        margin: 1cm;
    }
    
    body::before {
        content: "KGL Foundation - Applications Report";
        display: block;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #000;
    }
    
    /* Print date and time */
    body::after {
        content: "Printed: " attr(data-print-date);
        display: block;
        text-align: right;
        font-size: 10px;
        color: #666;
        margin-top: 20px;
    }
    
    /* Optimize statistics cards for print */
    .row {
        page-break-inside: avoid;
    }
    
    /* Remove large icons for print */
    .card-body i[style*="font-size"] {
        font-size: 1.5rem !important;
    }
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}


/* ==================== MODERN UI/UX ENHANCEMENTS ==================== */

/* Modern Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.nav-link {
    font-weight: 500;
    color: var(--gray-700) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: var(--gray-100);
}

/* Modern Cards */
.card {
    border: 1px solid var(--gray-200) !important;
    border-radius: var(--radius-lg) !important;
    background: white !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition) !important;
}

.card:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

.card-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%) !important;
    border-bottom: 2px solid var(--gray-100) !important;
    font-weight: 600 !important;
    padding: 1.25rem 1.5rem !important;
    border-top-left-radius: var(--radius-md) !important;
    border-top-right-radius: var(--radius-md) !important;
}

.card-header h5,
.card-header h4,
.card-header h6 {
    color: var(--gray-800) !important;
    margin-bottom: 0;
}

/* Modern Buttons */
.btn-primary {
    background: var(--primary-gradient) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2) !important;
}

.btn-primary:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

/* Dashboard Stats - Enhanced */
.stat-card {
    background: linear-gradient(135deg, white 0%, var(--gray-50) 100%) !important;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    opacity: 0.05;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-number {
    background: var(--primary-gradient);
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Modern Alerts */
.alert {
    border: none !important;
    border-radius: var(--radius-lg) !important;
    border-left: 4px solid !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Modern Tables */
.table {
    border-collapse: separate !important;
    border-spacing: 0 0.5rem !important;
}

.table thead th {
    background: var(--gray-100) !important;
    border: none !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    background: white !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition) !important;
}

.table tbody tr:hover {
    transform: scale(1.005) !important;
    box-shadow: var(--shadow) !important;
}

.table tbody td {
    border: none !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}


/* Active Navigation Link Styles */
.nav-link.active {
    font-weight: 600;
    position: relative;
    color: var(--primary-color) !important;
}

/* Active link underline - only on desktop */
@media (min-width: 992px) {
    .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 50%;
        transform: translateX(-50%);
        width: 80%;
        height: 2px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 2px 2px 0 0;
    }
}

/* Mobile - add background highlight instead */
@media (max-width: 991px) {
    .nav-link.active {
        background: rgba(102, 126, 234, 0.1);
        border-radius: 6px;
    }
}

/* Hover effect for non-active links */
.nav-link:not(.active):hover {
    color: var(--primary-color) !important;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
}

/* Dropdown active item */
.dropdown-item.active,
.dropdown-item:active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
}


/* Mobile Responsive Fixes */
/* Mobile Responsive Fixes */
@media (max-width: 767px) {
    /* Keep page header in flex row */
    .container .mb-4.d-flex.justify-content-between {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Heading and badge take full width */
    .container .mb-4 > div:first-child {
        width: 100%;
        flex: 0 0 100%;
        margin-bottom: 0.75rem;
    }
    
    /* First button (Back to List) on the left */
    .container .mb-4 a.btn:first-of-type {
        flex: 0 1 auto;
        margin-right: auto;
    }
    
    /* Last button (Print) on the right */
    .container .mb-4 a.btn:last-of-type,
    .container .mb-4 button.btn:last-of-type {
        flex: 0 1 auto;
        margin-left: auto;
    }
    
    /* Make sure buttons don't grow too large */
    .container .mb-4 .btn {
        max-width: 48%;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Document list on mobile */
    .list-group-item .d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .list-group-item .d-flex > div {
        width: 100%;
    }
    
    /* Download buttons full width */
    .list-group-item .btn {
        width: 100% !important;
        margin-top: 0.5rem;
        text-align: center;
        justify-content: center;
        display: flex;
        align-items: center;
    }
    
    /* Fix table columns on mobile */
    .table td,
    .table th {
        padding: 0.5rem !important;
        font-size: 0.875rem;
    }
    
    /* Make cards full width with proper padding */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Fix buttons in cards */
    .card-body .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Fix form buttons */
    .d-grid .btn {
        width: 100%;
    }
    
    /* Prevent horizontal overflow */
    .container,
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: hidden;
    }
    
    /* Fix long text overflow */
    .text-truncate-mobile {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
}

/* Small mobile devices */
@media (max-width: 575px) {
    /* Reduce font sizes */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    /* Smaller padding on cards */
    .card {
        margin-bottom: 0.75rem;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    /* Compact table on very small screens */
    .table {
        font-size: 0.8rem;
    }
    
    /* Hide less important columns on very small screens */
    .hide-mobile {
        display: none !important;
    }
}


/* Timeline Button Alignment on Mobile */
@media (max-width: 767px) {
    /* Center timeline buttons with the vertical line */
    .timeline-item,
    .application-timeline .timeline-item {
        display: flex;
        align-items: center;
        position: relative;
    }
    
    /* Timeline vertical line */
    .timeline-item::before,
    .application-timeline .timeline-item::before {
        content: '';
        position: absolute;
        left: 20px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: #e5e7eb;
        z-index: 0;
    }
    
    /* Timeline icon/button container */
    .timeline-icon,
    .timeline-item .btn,
    .timeline-item button {
        position: relative;
        z-index: 1;
        margin-left: 0;
        transform: translateX(-50%);
        left: 20px;
    }
    
    /* Ensure circular buttons are centered */
    .btn-circle,
    .rounded-circle {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Timeline content alignment */
    .timeline-content {
        margin-left: 50px;
        flex: 1;
    }
}


/* ========================================
   MODERN TYPOGRAPHY SYSTEM
   ======================================== */

:root {
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

body {
    font-family: var(--font-body) !important;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: var(--font-heading) !important;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Premium font weights */
h1, .display-1, .display-2 {
    font-weight: 800 !important;
}

h2, .display-3, .display-4 {
    font-weight: 700 !important;
}

h3, h4, .display-5, .display-6 {
    font-weight: 600 !important;
}

h5, h6 {
    font-weight: 600 !important;
}

.btn {
    font-family: var(--font-body) !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.navbar-brand {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
}

.lead {
    font-family: var(--font-body) !important;
    font-weight: 400;
    line-height: 1.7;
}

.card-title {
    font-family: var(--font-heading) !important;
    font-weight: 600;
}

/* Make text elements crisp */
p, li, span, a, label, input, textarea, select {
    font-family: var(--font-body) !important;
}

/* Numbers in stats look great with heading font */
.display-4 {
    font-family: var(--font-heading) !important;
    font-weight: 800 !important;
}

.fw-bold, .fw-600, .fw-500 {
    font-family: var(--font-body) !important;
}

/* Section titles */
.section-title {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em;
}


/* Thematic Area Cards */
.thematic-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thematic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.2);
    border-color: var(--primary-color);
}

.thematic-card.border-primary {
    border-color: var(--primary-color) !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.thematic-card input[type="radio"] {
    transform: scale(1.2);
}
