/* Monzo Agent Blazor App Styles */

:root {
    --monzo-coral: #F94D63;
    --monzo-dark-blue: #052767;
    --monzo-purple: #3a0647;
    --monzo-light-blue: #00A4DB;
    --monzo-navy: #14233C;
    --bg-light: #F5F7FA;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition-base: all 0.3s ease;
    --border-radius: 16px;
    --mobile-header-height: 56px;
    --mobile-nav-height: 64px;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-light);
    margin: 0;
    padding: 0;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--monzo-navy) 0%, var(--monzo-dark-blue) 50%, var(--monzo-purple) 100%);
    color: white;
    width: 260px;
    height: 100vh;
    position: fixed;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

main {
    flex: 1;
    margin-left: 260px;
    padding: 0;
    min-height: 100vh;
}

.top-row {
    background: white;
    border-bottom: 1px solid #e8ecef;
    height: var(--mobile-header-height);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 998;
}

.top-row h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--monzo-navy);
    margin: 0;
    letter-spacing: -0.5px;
}

.content {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: white !important;
    text-decoration: none;
    letter-spacing: -0.3px;
}

.navbar-toggler {
    background-color: transparent;
    border: none;
    color: var(--monzo-navy);
    padding: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

.navbar-toggler:active {
    color: var(--monzo-coral);
}

.nav-item {
    font-size: 0.95rem;
    padding-bottom: 0.1rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 12px;
    margin: 0.15rem 0.75rem;
    transition: var(--transition-base);
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: white !important;
    transform: translateX(3px);
}

.nav-link.active {
    background-color: rgba(249, 77, 99, 0.25);
    color: white !important;
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 28px;
    background-color: var(--monzo-coral);
    border-radius: 0 4px 4px 0;
}

.oi {
    width: 2rem;
    font-size: 1.2rem;
    vertical-align: middle;
    margin-right: 0.75rem;
}

/* Basic icons */
.oi-home::before { content: "🏠"; }
.oi-calculator::before { content: "💳"; }
.oi-document::before { content: "🧾"; }
.oi-envelope-closed::before { content: "✉️"; }
.oi-data-transfer-download::before { content: "⬇️"; }
.oi-list::before { content: "📋"; }
.oi-cart::before { content: "🛒"; }
.oi-arrow-right::before { content: "➡️"; }
.oi-pencil::before { content: "✏️"; }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    main {
        margin-left: 0;
    }
    
    .top-row {
        position: sticky;
        top: 0;
        z-index: 999;
    }
    
    .content {
        padding: 0.75rem;
        padding-bottom: calc(var(--mobile-nav-height) + 1rem);
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    /* Mobile-optimized cards */
    .card {
        margin-bottom: 0.75rem;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .card-header {
        padding: 0.75rem 1rem !important;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table td, .table th {
        padding: 0.5rem !important;
        white-space: nowrap;
    }
    
    /* Mobile button improvements */
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Mobile form improvements */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
    
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.4rem;
    }
    
    /* Mobile modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Stack columns on mobile */
    .row > [class*='col-'] {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .content {
        padding: 0.5rem;
    }
    
    .top-row h1 {
        font-size: 1.125rem;
    }
    
    .card {
        border-radius: 12px;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.7rem;
    }
}

/* Enhanced Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: var(--transition-base);
    background: white;
    overflow: hidden;
    margin-bottom: 1rem;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background: white;
    border-bottom: 1px solid #f0f2f5;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-title {
    margin-bottom: 0;
    color: var(--monzo-navy);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.card-body {
    padding: 1.25rem;
}

.card-text {
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Enhanced Button Styles */
.btn {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition-base);
    border: none;
    box-shadow: none;
    letter-spacing: -0.2px;
    font-size: 0.95rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--monzo-coral);
    color: white;
}

.btn-primary:hover {
    background: #e63950;
}

.btn-primary:disabled {
    background: #ffa5b4;
    opacity: 0.6;
}

.btn-success {
    background: #00D26A;
    color: white;
}

.btn-success:hover {
    background: #00b85a;
}

.btn-secondary {
    background: #E8EBED;
    color: var(--monzo-navy);
}

.btn-secondary:hover {
    background: #d5d9dc;
}

.btn-danger {
    background: #FF4444;
    color: white;
}

.btn-danger:hover {
    background: #e63939;
}

.btn-info {
    background: var(--monzo-light-blue);
    color: white;
}

.btn-info:hover {
    background: #0090c0;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.btn-outline-primary {
    border: 2px solid var(--monzo-coral);
    color: var(--monzo-coral);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--monzo-coral);
    color: white;
}

/* Enhanced Form Styles */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #E8EBED;
    padding: 0.75rem 1rem;
    transition: var(--transition-base);
    background: white;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--monzo-coral);
    box-shadow: 0 0 0 3px rgba(249, 77, 99, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--monzo-navy);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-text {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Enhanced Table Styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.table thead {
    background: var(--monzo-navy);
    color: white;
}

.table thead th {
    border: none;
    padding: 0.875rem 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody tr {
    transition: var(--transition-base);
    background: white;
}

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

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f2f5;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Mobile table optimization */
@media (max-width: 991.98px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
}

/* Enhanced Badge Styles */
.badge {
    padding: 0.5rem 0.85rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
}

.badge.bg-warning {
    background: #FFC107 !important;
    color: #333 !important;
}

.badge.bg-success {
    background: #00D26A !important;
    color: white !important;
}

.badge.bg-info {
    background: var(--monzo-light-blue) !important;
    color: white !important;
}

.badge.bg-secondary {
    background: #8B95A1 !important;
    color: white !important;
}

.badge.bg-primary {
    background: var(--monzo-coral) !important;
    color: white !important;
}

.badge.text-dark {
    color: #333 !important;
}

/* Enhanced Alert Styles */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
}

.alert-danger {
    background: #FFF0F0;
    color: #D32F2F;
    border-left: 4px solid #F44336;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid #4CAF50;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid #2196F3;
}

.alert-warning {
    background: #FFF8E1;
    color: #E65100;
    border-left: 4px solid #FF9800;
}

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

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

.card {
    animation: fadeIn 0.4s ease-out;
}

.alert {
    animation: slideInRight 0.3s ease-out;
}

/* Loading Spinner Enhancement */
.spinner-border {
    border-width: 0.2em;
    width: 1.2rem;
    height: 1.2rem;
    vertical-align: middle;
}

.spinner-border-sm {
    width: 0.9rem;
    height: 0.9rem;
}

/* Page Headers */
h1 {
    color: var(--monzo-navy);
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
}

h2, h3, h4, h5, h6 {
    color: var(--monzo-navy);
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Intro Text */
.intro-text {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}

.shadow-hover {
    transition: var(--transition-base);
}

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

/* Row Spacing */
.row {
    margin-bottom: 1rem;
}

.row:last-child {
    margin-bottom: 0;
}

/* Modal improvements */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #f0f2f5;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    color: var(--monzo-navy);
    font-size: 1.125rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f0f2f5;
    padding: 1rem 1.5rem;
}

.btn-close {
    background-size: 1rem;
}

.btn-close:focus {
    box-shadow: 0 0 0 0.2rem rgba(249, 77, 99, 0.25);
}

/* Improve mobile touch targets */
@media (max-width: 991.98px) {
    .btn, button, input, select, textarea {
        min-height: 44px; /* iOS recommended touch target */
    }
    
    .btn:not(.btn-sm):not(.navbar-toggler):not(.btn-close) {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        width: auto;
    }
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--monzo-coral);
    outline-offset: 2px;
}

/* Prevent text selection on buttons */
button, .btn {
    user-select: none;
    -webkit-user-select: none;
}

/* Sidebar overlay for mobile */
@media (max-width: 991.98px) {
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}