/* ============================================
   CRM Web - Modern Responsive Styles
   ============================================ */

:root {
    /* Color palette */
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Base styles */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Background styles */
.bg-gradient-main {
    background: var(--dark-gradient);
    background-attachment: fixed;
}

.bg-pattern {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(240, 147, 251, 0.2) 0%, transparent 40%);
    min-height: 100vh;
}

/* Glassmorphism card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
}

.glass-card .card-body {
    padding: 2rem;
}

/* Custom form controls */
.form-control-glass {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #212529;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control-glass::placeholder {
    color: #6c757d;
}

.form-control-glass:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    color: #212529;
    outline: none;
}

.form-label-light {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Gradient button */
.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white;
}

.btn-gradient:active {
    transform: translateY(0);
}

/* Secondary button */
.btn-outline-light-custom {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-outline-light-custom:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* Link styles */
.link-light-custom {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-light-custom:hover {
    color: var(--text-light);
}

/* Alert styles */
.alert-glass {
    background: rgba(220, 53, 69, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    color: #ff6b6b;
}

.alert-glass-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #51cf66;
}

/* Captcha box */
.captcha-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
}

/* Page title */
.page-title {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Dashboard cards */
.dashboard-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.dashboard-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.dashboard-card .stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table styles */
.table-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
}

.table-glass th {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-weight: 600;
    padding: 1rem;
    border: none;
}

.table-glass td {
    color: var(--text-light);
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.table-glass tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Navigation */
.navbar-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar-glass .nav-link {
    color: var(--text-light);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.navbar-glass .nav-link:hover {
    color: var(--primary-color);
}

/* Footer */
.footer-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem 0;
}

.footer-glass p {
    color: #212529 !important;
    margin: 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Responsive utilities */
@media (max-width: 576px) {
    .glass-card .card-body {
        padding: 1.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .dashboard-card .stat-value {
        font-size: 2rem;
    }
}

/* Focus styles */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

/* Loading spinner */
.spinner-gradient {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--glass-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Dark text overrides for content areas
   ============================================ */

/* Main content text - dark for readability */
.card,
.card-body,
.table,
.table th,
.table td,
.form-label,
.form-control,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #212529;
}

/* Keep table header styled appropriately */
.table-light th {
    color: #212529;
}

/* Keep specific table cell colors (Trans and Loyalty) */
.table .text-success {
    color: #198754 !important;
}

.table .text-danger {
    color: #dc3545 !important;
}

.table .fw-bold {
    color: #212529;
}

/* Form controls on white/light backgrounds */
.form-control {
    color: #212529;
    background-color: #fff;
}

.form-control:focus {
    color: #212529;
}

/* Alert text */
.alert-danger {
    color: #842029;
}

/* Keep glass components with light text */
.glass-card,
.glass-card .card-body,
.dashboard-card,
.dashboard-card .stat-value,
.dashboard-card .stat-label,
.navbar-glass .nav-link,
.footer-glass p,
.page-title,
.page-subtitle,
.form-label-light,
.form-control-glass,
.btn-outline-light-custom,
.link-light-custom {
    color: var(--text-light);
}

.glass-card .card-body h5,
.glass-card .card-body p {
    color: #212529;
}

/* Login page - dark text on glass card */
.glass-card .card-body h4,
.glass-card .form-label-light,
.glass-card .link-light-custom,
.page-subtitle {
    color: #212529;
}

/* Bootstrap Modal fix - ensure modal works with glassmorphism */
.modal-backdrop {
    z-index: 1050 !important;
}

.modal {
    z-index: 1055 !important;
}

.modal-dialog {
    z-index: 1056 !important;
}

.modal-content {
    z-index: 1057 !important;
    position: relative;
}

/* Ensure modal is above sidebar */
body.modal-open .sidebar-glass {
    z-index: 1040;
}