/* ============================================
   MODERN CREDIT CARD MANAGER - COMPLETE REDESIGN
   ============================================ */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Primary Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* Secondary Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --dark-bg: #0f172a;
    --darker-bg: #020617;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Light mode for login */
    --light-bg: #ffffff;
    --light-card: #f8fafc;
    --light-border: #e2e8f0;
    --light-text: #1e293b;
    --light-text-secondary: #64748b;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 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);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.2);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100%;
    scroll-behavior: smooth;
}

/* ============================================
   APP BODY & LAYOUT
   ============================================ */

.app-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    position: relative;
    overflow-x: hidden;
}

.app-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.app-shell {
    position: relative;
    z-index: 1;
    max-width: 1300px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.container-fluid {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

@media (max-width: 768px) {
    .app-shell {
        padding: var(--spacing-md);
    }
    .container-fluid {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .app-shell {
        padding: var(--spacing-sm);
    }
}

/* ============================================
   NAVBAR & HEADER
   ============================================ */

.navbar {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    padding: 1rem var(--spacing-md) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-light) !important;
    letter-spacing: 0.02em;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: var(--radius-lg);
    margin: 0.25rem 0;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover {
    color: var(--primary-light) !important;
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light) !important;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
    text-transform: none;
    cursor: pointer;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 0 0 1.5px rgba(99, 102, 241, 0.5);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #4338ca);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

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

.btn-warning:hover {
    background: #d97706;
}

.btn-outline-primary {
    border: 1.5px solid var(--primary-color);
    color: var(--primary-light);
    background: transparent;
}

.btn-outline-primary:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-light);
    color: white;
}

.btn-outline-secondary {
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
}

.btn-outline-danger {
    border: 1.5px solid var(--danger-color);
    color: var(--danger-color);
    background: transparent;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: #fca5a5;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
}

.btn-lg {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    color: var(--text-primary);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

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

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.card-text,
.card-subtitle {
    color: var(--text-secondary);
}

.card-colored {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.card-colored::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-full);
}

.badge-soft {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ============================================
   FORMS
   ============================================ */

.form-control,
.form-select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

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

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.input-group {
    gap: var(--spacing-sm);
}

.form-check {
    margin-bottom: var(--spacing-md);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    accent-color: var(--primary-color);
    background: var(--card-bg);
}

.form-check-input:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--text-secondary);
    margin-left: var(--spacing-md);
    cursor: pointer;
    font-weight: 500;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    color: var(--text-primary);
    border-collapse: collapse;
    margin-bottom: 0;
}

.table thead th {
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-light);
    font-weight: 600;
    padding: var(--spacing-md);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.table tbody tr.table-success {
    background: rgba(16, 185, 129, 0.1);
}

.table tbody tr.table-success:hover {
    background: rgba(16, 185, 129, 0.15);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    border-radius: var(--radius-lg);
    border: 1px solid;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.alert-primary {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-light);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success-color);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning-color);
    color: #fcd34d;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-color);
    color: #fca5a5;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--info-color);
    color: #93c5fd;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: var(--spacing-lg);
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

h5 {
    font-size: 1rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.text-muted {
    color: var(--text-muted) !important;
}

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

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
    height: 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--spacing-md) 0;
    border: 1px solid var(--border-color);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transition: width 0.6s ease;
    height: 100%;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--dark-bg), var(--darker-bg));
    position: relative;
    overflow: hidden;
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: var(--radius-xl);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    padding: var(--spacing-2xl);
}

.login-card h2 {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    color: var(--primary-light);
    font-size: 1.5rem;
}

.login-form .form-group:last-child {
    margin-bottom: 0;
}

/* ============================================
   UTILITIES
   ============================================ */

.gap-2 {
    gap: var(--spacing-sm);
}

.gap-3 {
    gap: var(--spacing-md);
}

.gap-4 {
    gap: var(--spacing-lg);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.text-center {
    text-align: center;
}

.text-end {
    text-align: end;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: start;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-end {
    justify-content: flex-end;
}

.fw-light {
    font-weight: 300;
}

.fw-normal {
    font-weight: 400;
}

.fw-semibold {
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}

.small {
    font-size: 0.875rem;
}

.fs-4 {
    font-size: 1.25rem;
}

.fs-5 {
    font-size: 1rem;
}

.h3 {
    font-size: 1.5rem;
}

.h4 {
    font-size: 1.1rem;
}

.h5 {
    font-size: 1rem;
}

.h6 {
    font-size: 0.875rem;
}

.rounded-3 {
    border-radius: var(--radius-lg);
}

.border {
    border: 1px solid var(--border-color);
}

.border-0 {
    border: none;
}

.border-top {
    border-top: 1px solid var(--border-color);
}

.bg-light {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

.bg-white {
    background: var(--light-bg) !important;
    color: var(--light-text) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: var(--spacing-sm);
    }
    
    .nav-link {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.95rem;
    }
    
    .login-card {
        padding: var(--spacing-xl);
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.25rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    h3 {
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .form-control,
    .form-select {
        font-size: 16px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

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

/* ============================================
   ACCESSIBILITY
   ============================================ */

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

/* ============================================
   TOKEN EXPIRY COUNTDOWN
   ============================================ */

#token-status {

/* ============================================
   APP FOOTER BRANDING
   ============================================ */

.app-footer {
    margin-top: auto !important;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85)) !important;
    border-top: 1px solid rgba(99, 102, 241, 0.2) !important;
    font-size: 0.85rem;
}

.app-footer p {
    margin: 0;
}

.app-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-shell {
    flex: 1;
}
    animation: pulse 2s infinite;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

#token-status.bg-warning {
    animation: pulse-warning 1s infinite;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    }
}

#logout-btn {
    transition: all 0.3s ease;
}

#logout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

