/* ========================================
   BILLTRACE - MOBILE-FIRST RESPONSIVE CSS
   ======================================== */

:root {
    --primary-color: #6B7280;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #6366F1;
    --dark-color: #374151;
    --light-color: #F9FAFB;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* ========================================
   GLOBAL MOBILE STYLES
   ======================================== */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f6fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Remove desktop padding */
body.az-body {
    padding-top: 0;
    padding-bottom: 0;
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.container,
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
}

.az-content {
    padding: 10px 15px;
}

.az-content-dashboard {
    padding: 10px 15px;
}

/* ========================================
   MOBILE HEADER & NAVIGATION
   ======================================== */

.mobile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4B5563 100%);
    color: white;
    padding: 12px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-logo {
    max-height: 40px;
    width: auto;
}

.mobile-menu-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Dropdown Menu Mobile Optimization */
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
    min-width: 200px;
}

.dropdown-item {
    padding: 12px 20px;
    font-size: 15px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.dropdown-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* ========================================
   CARDS & PANELS
   ======================================== */

.card,
.az-card-signin {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
    margin-bottom: 20px;
    background: white;
}

.card-body {
    padding: 20px;
}

.az-card-signin {
    max-width: 100%;
    margin: 20px auto;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.az-signin-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
}

/* ========================================
   FORMS & INPUTS
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #6B7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
    outline: none;
}

label {
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    color: #374151;
    font-size: 14px;
}

.input-group {
    display: flex;
    width: 100%;
}

.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text,
.input-group-append .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid #dfe6e9;
    border-left: none;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px; /* Touch-friendly */
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-primary,
.btn-az-primary {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
    border: none;
}

.btn-primary:hover,
.btn-az-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 114, 128, 0.3);
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
}

.btn-secondary {
    background-color: #636e72;
    color: white;
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-indigo {
    background-color: #4B0082;
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   TABLES
   ======================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.table {
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    font-size: 14px;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3498DB 100%);
    color: white;
}

.table thead th {
    padding: 12px 10px;
    font-weight: 600;
    white-space: nowrap;
    font-size: 13px;
}

.table tbody td {
    padding: 12px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f2f6;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Mobile Table Cards */
@media (max-width: 768px) {
    .table-card-mobile {
        display: block;
        width: 100%;
    }
    
    .table-card-mobile thead {
        display: none;
    }
    
    .table-card-mobile tbody,
    .table-card-mobile tr,
    .table-card-mobile td {
        display: block;
        width: 100%;
    }
    
    .table-card-mobile tr {
        background: white;
        border-radius: var(--border-radius);
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .table-card-mobile td {
        text-align: left;
        padding: 8px 0;
        border: none;
        position: relative;
        padding-left: 50%;
    }
    
    .table-card-mobile td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        font-weight: 600;
        color: var(--dark-color);
    }
}

/* ========================================
   MODALS
   ======================================== */

.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3498DB 100%);
    color: white;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    border-bottom: none;
    padding: 20px;
}

.modal-title {
    font-weight: 600;
    font-size: 18px;
}

.modal-body {
    padding: 25px 20px;
}

.modal-footer {
    border-top: 1px solid #f1f2f6;
    padding: 15px 20px;
}

.btn-close,
.close {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    opacity: 1;
    color: white;
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-lg {
        max-width: calc(100% - 20px);
    }
}

/* ========================================
   DASHBOARD CARDS
   ======================================== */

.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.dashboard-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.dashboard-card-title {
    font-size: 14px;
    color: #636e72;
    margin-bottom: 8px;
}

.dashboard-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
}

/* ========================================
   LISTS
   ======================================== */

.list-group-item {
    border: none;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 15px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.list-group-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */

.alert {
    border-radius: var(--border-radius);
    padding: 15px 20px;
    border: none;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.text-danger {
    color: var(--danger-color) !important;
    font-size: 13px;
    display: block;
    margin-top: 5px;
}

/* ========================================
   LOADING & SPINNERS
   ======================================== */

.spinner-border {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ========================================
   LOGIN & SIGNUP PAGES
   ======================================== */

.az-signin-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.az-signin-header h4 {
    font-size: 16px;
    color: #636e72;
    margin-bottom: 30px;
    font-weight: 400;
}

.az-signin-footer {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #f1f2f6;
    text-align: center;
}

.az-signin-footer p {
    margin: 10px 0;
    font-size: 14px;
}

.az-signin-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.az-logo {
    text-align: center;
    margin-bottom: 30px;
}

.az-logo img {
    max-width: 200px;
    height: auto;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

h1, .h1 { font-size: 28px; font-weight: 700; margin-bottom: 20px; }
h2, .h2 { font-size: 24px; font-weight: 700; margin-bottom: 18px; }
h3, .h3 { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
h4, .h4 { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
h5, .h5 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
h6, .h6 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }

@media (min-width: 768px) {
    h1, .h1 { font-size: 36px; }
    h2, .h2 { font-size: 30px; }
    h3, .h3 { font-size: 24px; }
    h4, .h4 { font-size: 20px; }
}

/* ========================================
   CHARTS
   ======================================== */

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .chart-container {
        height: 400px;
    }
}

/* ========================================
   DATE PICKER
   ======================================== */

.datepicker {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover {
    background-color: var(--primary-color);
    background-image: none;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f2f6;
}

::-webkit-scrollbar-thumb {
    background: #b2bec3;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #636e72;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

/* ========================================
   BOTTOM NAVIGATION (Optional)
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.bottom-nav-item {
    flex: 1;
    text-align: center;
    padding: 8px;
    color: #636e72;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bottom-nav-item i {
    font-size: 20px;
}

.bottom-nav-item span {
    font-size: 11px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary-color);
}

/* ========================================
   MEDIA QUERIES
   ======================================== */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .az-card-signin {
        max-width: 500px;
        padding: 40px 30px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .mobile-header,
    .bottom-nav,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .container,
    .container-fluid {
        width: 100%;
        max-width: 100%;
    }
}

/* ========================================
   DARK MODE (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1e1e1e;
        color: #f1f2f6;
    }
    
    .card,
    .az-card-signin,
    .dashboard-card {
        background-color: #2d2d2d;
        color: #f1f2f6;
    }
    
    .form-control,
    input,
    select,
    textarea {
        background-color: #3d3d3d;
        color: #f1f2f6;
        border-color: #4d4d4d;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
}

/* ========================================
   CUSTOM COMPONENTS
   ======================================== */

/* Bill Links */
.bill-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.bill-link:hover {
    text-decoration: underline;
    color: #3498DB;
}

/* Outlet Messages */
.outlet-error {
    color: var(--danger-color);
    font-weight: 600;
}

.outlet-valid {
    color: var(--secondary-color);
    font-weight: 600;
}

.outlet-message {
    font-size: 14px;
    margin-top: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    color: #b2bec3;
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: 14px;
    color: #636e72;
}

