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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --info-light: #dbeafe;
    --background: #f8fafc;
    --background-alt: #f1f5f9;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-color-light: #f1f5f9;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1:focus {
    outline: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 460px;
    animation: slideUp 0.4s ease-out;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.valid.modified:not([type=checkbox]) {
    border-color: var(--success-color);
}

.invalid {
    border-color: var(--danger-color);
}

.validation-message {
    color: var(--danger-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}

.btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: inline-block;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.dashboard-container {
    min-height: 100vh;
    background: var(--background);
}

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.navbar-brand {
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

/* Mobile toggle button - hidden on desktop */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.navbar-toggle:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.navbar-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.navbar-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    position: relative;
    display: inline-flex;
    align-items: center;
}

.navbar-link:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.navbar-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.navbar-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.main-content {
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-out;
}

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

.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color-light);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 400;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

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

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color-light);
    color: var(--text-primary);
}

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--background);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background: var(--background);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-admin {
    background: #dbeafe;
    color: #1e40af;
}

.badge-merchant {
    background: #fef3c7;
    color: #92400e;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2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gMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

#blazor-error-ui {
    background: var(--danger-color);
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    padding: 0 0.5rem;
}

/* MudBlazor Custom Styles */
.mud-table-custom {
    background: transparent !important;
}

.mud-table-custom .mud-table-head {
    background: var(--background-alt) !important;
}

.mud-table-custom .mud-table-cell {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1rem !important;
    font-size: 0.875rem !important;
}

.mud-table-custom .mud-table-row {
    transition: all 0.2s ease !important;
}

.mud-table-custom .mud-table-row:hover {
    background: var(--primary-light) !important;
    transform: scale(1.005);
}

/* Dashboard Cards */
.dashboard-card {
    transition: all 0.3s ease !important;
    border: 1px solid var(--border-color) !important;
    overflow: hidden;
    position: relative;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--primary-color) !important;
}

.dashboard-card:hover::before {
    transform: scaleX(1);
}

/* MudBlazor Component Overrides */
.mud-dialog {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
}

.mud-dialog-title {
    font-weight: 600 !important;
    font-size: 1.25rem !important;
    color: var(--text-primary) !important;
}

.mud-button-root {
    border-radius: var(--radius-sm) !important;
    text-transform: none !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.mud-button-filled-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%) !important;
}

.mud-button-filled-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md) !important;
}

.mud-input {
    border-radius: var(--radius-sm) !important;
}

.mud-input-root {
    border-radius: var(--radius-sm) !important;
}

.mud-chip {
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
}

.mud-snackbar {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
}

.mud-card {
    border-radius: var(--radius-lg) !important;
    transition: all 0.3s ease !important;
}

.mud-card-header {
    padding: 1.5rem !important;
}

.mud-card-content {
    padding: 1.5rem !important;
}

.mud-progress-linear {
    border-radius: 9999px !important;
}

.mud-icon-button {
    transition: all 0.2s ease !important;
}

.mud-icon-button:hover {
    transform: scale(1.1);
}

/* Utility Classes */
.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

/* Transactions Page Styles */
.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.transactions-search {
    max-width: 400px;
    min-width: 250px;
    margin-left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-wrap: wrap;
        position: relative;
    }
    
    /* Show mobile toggle button */
    .navbar-toggle {
        display: block;
        order: 2;
    }
    
    .navbar-brand {
        order: 1;
        font-size: 1.125rem;
    }
    
    /* Hide brand text on very small screens */
    .navbar-brand-text {
        display: inline;
    }
    
    /* Mobile menu - hidden by default */
    .navbar-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        gap: 0.5rem;
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid var(--border-color);
        animation: slideDown 0.3s ease-out;
    }
    
    /* Show mobile menu when open */
    .navbar-menu.mobile-open {
        display: flex;
    }
    
    .navbar-link {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        justify-content: flex-start;
    }
    
    .navbar-link.active::after {
        display: none;
    }
    
    .navbar-link.active {
        border-left: 3px solid var(--primary-color);
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .login-card {
        padding: 2rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    /* Transactions page mobile styles */
    .transactions-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .transactions-search {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
    }
}

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

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* Hide brand text on very small screens */
    .navbar-brand-text {
        display: none;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
    }
}

/* Admin Action Item Hover Effect */
.admin-action-item:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.admin-action-item:hover .mud-icon {
    opacity: 1 !important;
}

/* Responsive Table/Card Toggle */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .transaction-card {
        transition: all 0.2s ease;
    }
    
    .transaction-card:active {
        transform: scale(0.98);
    }
}