/* Novellus Loan Management System - Custom Styles */

/* Font-face declaration for locally hosted Brother 1816 Light */
@font-face {
    font-family: "Brother 1816";
    src: url("/fonts/brother-1816-light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Global Styles - Novellus Theme */
:root {
    --primary-color: #AD965F;  /* Novellus Gold */
    --secondary-color: #AD965F;  /* Novellus Navy */
    --success-color: green;  /* Dark Gold for success */
    --danger-color: #dc3545;
    --warning-color: #CDA44C;  /* Light Gold for warnings */
    --info-color: #2D3A49;  /* Light Navy for info */
    --light-color: #FFFFFF;  /* Page Background */
    --dark-color: #1E2B3A;  /* Novellus Navy */
    --font-family: 'Brother 1816', Arial, sans-serif;
}

html, body {
    overflow-x: hidden; /* Prevent horizontal scrollbars on all pages */
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

/* Navigation - Novellus Theme */
.navbar {
    background-color: #AD965F !important;
    background-image: none !important;
    min-height: 60px;
}

/* Alternate gold navbar for select pages */
.gold-nav .navbar {
    background-color: #AD965F !important;
    background-image: none !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    color: rgba(255, 255, 255, 0.9) !important;
}

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

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* Navbar heading */
.navbar-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.navbar-title .navbar-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Sidebar navigation */
#sidebarMenu {
    --bs-offcanvas-width: 300px; /* 25% reduction from default width */
}

#sidebarMenu .nav-link {
    font-size: 1.1rem; /* increase font size of list items */
}

#sidebarMenu .nav-link:hover,
#sidebarMenu .nav-link:focus,
#sidebarMenu .nav-link.active {
    background-color: var(--primary-color);
    color: #fff !important;
}

#sidebarMenu .nav-link:hover i,
#sidebarMenu .nav-link:focus i,
#sidebarMenu .nav-link.active i {
    color: #fff !important;
}

/* Cards - Updated for Novellus Theme (moved to novellus-theme.css) */

/* Buttons - Novellus Theme */
.btn {
    font-weight: 600;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    font-family: var(--font-family);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn:hover,
.btn:focus {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #AD965F 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(184, 134, 11, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #AD965F 0%, #5D4409 100%);
    border-color: #AD965F;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(184, 134, 11, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #0F1923;
    border-color: #0F1923;
    color: white;
}

.btn-outline-primary {
    color: var(--dark-color);
    border: 2px solid var(--primary-color);
    background-color: white;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-check:focus + .btn-outline-primary,
.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(173, 150, 95, 0.35) !important;
    outline: none;
}

.btn-check:focus + .btn-outline-secondary,
.btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.25rem rgba(30, 43, 58, 0.35) !important;
    outline: none;
}

.btn-outline-secondary {
    color: var(--dark-color);
    border: 2px solid var(--dark-color);
    background-color: white;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
    color: white;
}

/* Override any remaining blue elements */
.text-info {
    color: var(--secondary-color) !important;
}

.btn-info {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: white !important;
}

.btn-info:hover {
    background-color: var(--dark-color) !important;
    border-color: var(--dark-color) !important;
}

/* Calculate button - ensure no blue */
.calculate-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, #AD965F 100%) !important;
    border: none !important;
    color: white !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-radius: 1rem !important;
}

/* Calculator Specific Styles */
.calculator-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    padding-left: 10px;
    padding-right: 10px;
}

.results-section {
    background: white;
    border: 1px solid #dee2e6;
    min-height: 400px;
    padding-left: 10px;
    padding-right: 10px;
}

.result-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
    border-radius: 0.75rem;
    transition: transform 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Input Group */
.input-group-text {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    font-weight: 500;
}

/* Tables */
.table {
    font-size: 0.9rem;
}

.table th {
    font-weight: 600;
    border-top: none;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.075);
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1rem;
}

/* Progress */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
}

.progress-bar {
    background-color: var(--primary-color);
    transition: width 0.6s ease;
}

/* Pagination */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    color: var(--primary-color);
    border: 1px solid #dee2e6;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dropdowns */
.dropdown-menu {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.dropdown-item {
    font-weight: 500;
    transition: background-color 0.15s ease-in-out;
}

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

/* Modals */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-title {
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: auto;
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6;
}

/* Utility Classes */
.text-truncate-custom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.border-radius-lg {
    border-radius: 0.75rem !important;
}

.shadow-sm-custom {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Currency Specific Styles */
.currency-gbp {
    color: #28a745;
}

.currency-eur {
    color: #007bff;
}

.currency-usd {
    color: #ffc107;
}

/* Status Indicators */
.status-draft { color: #6c757d; }
.status-submitted { color: #007bff; }
.status-under-review { color: #ffc107; }
.status-approved { color: #28a745; }
.status-rejected { color: #dc3545; }

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .result-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar, .btn, .pagination, footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .result-card {
        background: white !important;
        color: black !important;
        border: 1px solid #dee2e6 !important;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    body {
        background: white !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #343a40;
        color: white;
    }
    
    .form-control, .form-select {
        background-color: #495057;
        border-color: #6c757d;
        color: white;
    }
    
    .table {
        color: white;
    }
    
    .table th {
        background-color: #495057;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    box-shadow: none;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .card {
        border-width: 2px;
    }
    
    .form-control,
    .form-select {
        border-width: 2px;
    }
}

/* Loan summary modal sizing */
#loanSummaryFieldsModal .modal-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    margin: 0;
}

#loanSummaryFieldsModal .modal-content {
    min-height: 100vh;
    border-radius: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Save/Update Loan button styling */
#saveLoanBtn {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}

#saveLoanBtn:hover,
#saveLoanBtn:focus,
#saveLoanBtn:disabled {
    background-color: #fff !important;
    color: #000 !important;
}
