﻿/* =========================
   CARDS
   ========================= */

.card {
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 20px -8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1.5rem;
}

.card-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    letter-spacing: 0.01em;
}

.card-header {
    border-radius: 1rem 1rem 0rem 0rem !important;
    padding: 1rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.5) !important;
    color: #1e293b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
}

    .card-header h5 {
        font-size: 1.125rem;
        margin-bottom: 0;
        font-weight: 600;
        line-height: 1.4;
        color: #1e293b;
    }

    .card-header h6 {
        font-size: 1rem;
        margin-bottom: 0;
        font-weight: 600;
        line-height: 1.4;
        color: #1e293b;
    }

    .card-header small {
        display: block;
        padding-left: 1.5rem;
        color: #64748b;
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }

    .card-header i.text-primary {
        color: var(--color-primary) !important;
    }

/* Enhanced text styles within cards */
.card-body p {
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 1rem;
}

.card-body h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-body .text-muted {
    color: #64748b !important;
    font-size: 0.9rem;
}

.card-body small {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 10px 15px -8px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-4px) !important;
}

/* =========================
   MOBILE CARD ENHANCEMENTS
   ========================= */

@media (max-width: 575.98px) {

    /* Card adjustments for extra small devices */
    .card {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0.5rem;
    }

    .card-body {
        padding: 1.25rem;
        font-size: 1rem;
        line-height: 1.6;
    }

    .card-header h5 {
        font-size: 1.125rem;
        line-height: 1.4;
    }

    .card-body p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .card-body h6 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .card-body .text-muted {
        font-size: 0.9rem;
    }

    .card-body small {
        font-size: 0.875rem;
    }
}

@media (max-width: 767.98px) {

    .card-body {
        font-size: 1rem;
        line-height: 1.6;
        padding: 1.25rem;
    }

    .card-header h5 {
        font-size: 1.125rem;
        font-weight: 600;
        line-height: 1.3;
    }

    .card.bg-light {
        margin-top: 1rem;
    }

        .card.bg-light .card-body {
            padding: 1.25rem;
            font-size: 1rem;
            line-height: 1.5;
        }

        .card.bg-light .row {
            margin-bottom: 0.75rem;
        }

            .card.bg-light .row:last-child {
                margin-bottom: 0;
            }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .mobile-line-item {
        border: 2px solid !important;
    }
}

/* =========================
   SETTINGS CARDS
   ========================= */

.settings-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 20px -8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .settings-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.2), 0 15px 25px -10px rgba(0, 0, 0, 0.12);
    }

    .settings-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #086973, #0891b2);
    }

.user-info-card {
    background: rgba(255, 255, 255, 0.9);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

    .settings-card-header i {
        font-size: 1.5rem;
        color: #086973;
    }

    .settings-card-header h5 {
        font-size: 1.25rem;
        font-weight: 600;
        color: #1e293b;
        margin: 0;
        line-height: 1.4;
    }

    .settings-card-header p {
        font-size: 1rem;
        color: #64748b;
        margin-top: 0.5rem;
        line-height: 1.5;
    }

/* Enhanced text content in settings cards */
.settings-card p,
.settings-card .form-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
}

.settings-card label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
}

.settings-card .form-control {
    font-size: 1rem;
    line-height: 1.5;
}

/* QuickBooks Integration Card */
.qb-integration-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

    .qb-integration-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

    .qb-integration-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #2e7d0f, #65a30d);
    }

.qb-card-header {
    background: linear-gradient(135deg, #f0fdf4, #ffffff);
    padding: 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qb-logo {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.status-connected {
    background: #dcfce7;
    color: #166534;
}

.status-disconnected {
    background: #fef2f2;
    color: #dc2626;
}

.qb-toggle-section {
    padding: 2rem;
}

/* QuickBooks Mobile Responsive Styles */
@media (max-width: 576px) {
    .qb-integration-card {
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
    }

    .qb-card-header {
        padding: 1.5rem;
        gap: 0.75rem;
    }

    .qb-logo {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }

    .qb-card-header h5 {
        font-size: 1.125rem !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.4 !important;
    }

    .qb-card-header p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        color: #64748b !important;
    }

    .status-badge {
        padding: 0.4rem 0.75rem !important;
        font-size: 0.8rem !important;
        border-radius: 1.5rem !important;
        font-weight: 600 !important;
    }

    .qb-toggle-section {
        padding: 1.5rem;
    }

        .qb-toggle-section p,
        .qb-toggle-section .form-text {
            font-size: 1rem !important;
            line-height: 1.6 !important;
            color: #475569 !important;
        }

        .qb-toggle-section label {
            font-size: 0.95rem !important;
            font-weight: 600 !important;
            line-height: 1.4 !important;
        }
}

/* Tablet responsive styles for QuickBooks */
@media (min-width: 577px) and (max-width: 768px) {
    .qb-card-header {
        padding: 1.75rem;
    }

    .qb-logo {
        width: 2.75rem;
        height: 2.75rem;
    }

    .qb-card-header h5 {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .qb-card-header p {
        font-size: 1rem;
        line-height: 1.5;
        color: #64748b;
    }

    .qb-toggle-section {
        padding: 1.75rem;
    }

        .qb-toggle-section p,
        .qb-toggle-section .form-text {
            font-size: 1rem;
            line-height: 1.6;
            color: #475569;
        }
}

/* =========================
   DESKTOP CARD TYPOGRAPHY ENHANCEMENTS
   ========================= */

@media (min-width: 768px) {
    .card-body {
        font-size: 1.0625rem; /* 17px */
        line-height: 1.6;
        letter-spacing: 0.01em;
    }

    .card-header h5 {
        font-size: 1.1875rem; /* 19px */
        line-height: 1.4;
    }

    .card-body p {
        font-size: 1.0625rem;
        line-height: 1.6;
        margin-bottom: 1.25rem;
    }

    .card-body h6 {
        font-size: 1.0625rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }

    .card-body .text-muted {
        font-size: 0.9375rem; /* 15px */
        line-height: 1.5;
    }

    .card-body small {
        font-size: 0.9375rem;
        line-height: 1.5;
    }
}

/* =========================
   LARGE SCREEN TYPOGRAPHY OPTIMIZATIONS
   ========================= */

@media (min-width: 1200px) {
    .card-body {
        font-size: 1.125rem; /* 18px */
        line-height: 1.6;
        padding: 2rem;
    }

    .card-header h5 {
        font-size: 1.25rem; /* 20px */
        line-height: 1.4;
    }

    .card-body p {
        font-size: 1.125rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .card-body h6 {
        font-size: 1.125rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
}

/* =========================
   STATS CARDS - DASHBOARD STYLE
   ========================= */

.stats-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 20px -8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 5.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.2), 0 15px 25px -10px rgba(0, 0, 0, 0.12);
}

.stats-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-icon i {
    font-size: 1.25rem;
    color: white;
}

.stats-content {
    min-width: 0;
    flex: 1;
}

.stats-title {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.stats-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-card .text-muted,
.stats-card small.text-muted,
.stats-content .text-muted {
    color: #64748b !important;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.125rem;
}

/* Stats Card Gradient Backgrounds */
.bg-primary-gradient { background: linear-gradient(135deg, #086973, #0891b2); }
.bg-success-gradient { background: linear-gradient(135deg, #059669, #10b981); }
.bg-info-gradient { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.bg-warning-gradient { background: linear-gradient(135deg, #d97706, #fbbf24); }
.bg-danger-gradient { background: linear-gradient(135deg, #dc2626, #ef4444); }
.bg-purple-gradient { background: linear-gradient(135deg, #7c3aed, #a78bfa); }

/* Stats Card Responsive Adjustments */
@media (max-width: 767.98px) {
    .stats-card {
        padding: 0.75rem;
        gap: 0.5rem;
        min-height: auto;
        height: auto;
    }
    
    .stats-icon {
        width: 2.25rem;
        height: 2.25rem;
        flex-shrink: 0;
    }
    
    .stats-icon i {
        font-size: 0.9rem;
    }
    
    .stats-title {
        font-size: 0.55rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }
    
    .stats-value {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }
    
    .stats-content {
        overflow: hidden;
        min-width: 0;
    }
}

/* Extra small screens - Full width stats cards with larger values */
@media (max-width: 575.98px) {
    /* Reduce gap between stats cards in mobile */
    .row.g-3:has(.stats-card) {
        --bs-gutter-y: 0.5rem;
    }
    
    .stats-card {
        padding: 1rem 1.25rem;
        gap: 1rem;
        flex-direction: row;
        align-items: center;
        border-radius: 0.75rem;
        min-height: auto;
        height: auto;
    }
    
    .stats-icon {
        width: 3rem;
        height: 3rem;
        border-radius: 0.625rem;
        flex-shrink: 0;
    }
    
    .stats-icon i {
        font-size: 1.25rem;
    }
    
    .stats-content {
        flex: 1;
        text-align: left;
        overflow: hidden;
        min-width: 0;
    }
    
    .stats-title {
        font-size: 0.75rem;
        letter-spacing: 0.02em;
        margin-bottom: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .stats-value {
        font-size: 1.5rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Small text under stats value */
    .stats-card small.text-muted,
    .stats-content .text-muted {
        font-size: 0.65rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
}

/* =========================
   LOGO MANAGEMENT CARD - GLASSMORPHISM
   ========================= */

.logo-management-card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 20px -8px rgba(0, 0, 0, 0.1) !important;
}

.logo-card-header {
    background: rgba(255, 255, 255, 0.5) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5) !important;
}


/* =========================
   MOBILE CARDS FOR CLIENTS/EMPLOYEES
   ========================= */

.mobile-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    margin-bottom: 1.5rem !important;
    position: relative;
}

    .mobile-card:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light-gray, #f3f4f6);
}

.mobile-card-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-dark, #1e293b);
    display: flex;
    align-items: center;
}

.mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-card-field {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-text-muted, #6b7280);
}

    .mobile-card-field .text-truncate {
        max-width: calc(100% - 2rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* Ensure dropdowns in mobile cards work properly */
.mobile-card .dropdown-menu {
    position: absolute;
    z-index: 1050;
}

/* Ensure mobile card with open dropdown is on top */
.mobile-card .dropdown.show,
.mobile-card:has(.dropdown-menu.show) {
    z-index: 1051;
}

.mobile-cards-container .mobile-card:has(.dropdown-menu.show) {
    z-index: 1051;
}

/* Touch-friendly dropdown button */
.mobile-card .dropdown .btn-link {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
