﻿/* Color variables */
:root {
    --primary: #3A767A;
    --primary-600: #2f6164;
    --primary-700: #254a4d;
    --primary-light: rgba(58,118,122,.10);
    --secondary: #3FAC72;
    --secondary-600: #2f945f;
    --secondary-light: rgba(63,172,114,.10);
    --tertiary: #E04852;
    --tertiary-600: #c63f48;
    --tertiary-light: rgba(224,72,82,.10);
    --surface: #fff;
    --surface-2: #f7f9fb;
    --surface-3: #eef3f5;
    --border: #e5e7eb;
    --border-light: #f1f5f9;
    --text: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
}

/* Modal enhancements */
.modal-xl {
    max-width: 800px; /* Reduced from 90% */
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-header {
    background: var(--primary);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem;
}

    .modal-header .btn-close {
        color: white;
        opacity: 1;
        filter: brightness(0) invert(1);
    }

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Form styling */
.form-section {
    background: var(--surface-2);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.form-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

    .form-label.required::after {
        content: " *";
        color: var(--tertiary);
        font-weight: bold;
    }

.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 0.2rem var(--primary-light);
    }

/* Autocomplete styles */
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1050 !important;
}

.ui-menu-item {
    padding: 0;
}

    .ui-menu-item .ui-menu-item-wrapper {
        padding: 8px 12px;
        color: var(--text);
        font-size: 0.9rem;
        border: none;
    }

        .ui-menu-item .ui-menu-item-wrapper:hover,
        .ui-menu-item .ui-state-active {
            background: var(--primary-light) !important;
            color: var(--primary) !important;
            border: none !important;
            margin: 0;
        }

/* Passport upload styling */
.passport-upload {
    text-align: center;
    cursor: pointer;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--surface-2);
}

    .passport-upload:hover {
        border-color: var(--primary);
        background: var(--primary-light);
    }

.passport-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 0.75rem;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

    .upload-hint i {
        color: var(--primary);
        margin-right: 0.25rem;
    }

/* Button styling */
.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    border: none;
    box-shadow: 0 2px 6px var(--primary-light);
}

    .btn-primary:hover {
        background: var(--primary-600);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(58,118,122,0.3);
    }

.btn-outline-secondary {
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}

    .btn-outline-secondary:hover {
        background: var(--surface-2);
        border-color: var(--text-muted);
        transform: translateY(-1px);
    }

.btn-success {
    background: var(--secondary);
    border: none;
}

    .btn-success:hover {
        background: var(--secondary-600);
    }

/* Statistics cards styling */
.stats-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    color: var(--text);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

    .stat-item .stat-value {
        color: var(--primary);
        font-size: 2rem;
        font-weight: 700;
        line-height: 1.2;
    }

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 3px;
}

/* Filter bar styling */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    background: var(--surface);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.search-box {
    flex: 2;
    min-width: 220px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding: 10px 12px 10px 35px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .search-input:focus {
        border-color: var(--primary);
        outline: none;
        box-shadow: 0 0 0 3px var(--primary-light);
    }

.filter-select {
    flex: 1;
    min-width: 130px;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .filter-select:focus {
        border-color: var(--primary);
        outline: none;
        box-shadow: 0 0 0 3px var(--primary-light);
    }

/* Dependent card styling */
.dependents-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.dependent-card {
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

    .dependent-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
        border-color: var(--primary-light);
    }

.card-header {
    background: var(--surface-2);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.dependent-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.dependent-relationship {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card-body {
    padding: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-value {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

.policy-number {
    background: var(--surface-2);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text);
    border: 1px solid var(--border-light);
}

.card-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-active {
    background: var(--secondary-light);
    color: var(--secondary-600);
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-inactive {
    background: var(--tertiary-light);
    color: var(--tertiary-600);
}

.action-buttons {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-icon:hover {
        background: var(--primary-light);
        color: var(--primary);
        transform: translateY(-1px);
    }

/* Loading state */
.loading-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.empty-title {
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-description {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 15px;
    font-size: 0.95rem;
}

/* ID Card styling */
.id-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border: 1px solid var(--border-light);
}

.id-card-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

    .id-card-header h3 {
        color: var(--primary);
        font-weight: 700;
    }

.id-card-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.info-row {
    display: flex;
    margin-bottom: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-light);
}

    .info-row .info-label {
        width: 120px;
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.85rem;
    }

    .info-row .info-value {
        flex: 1;
        color: var(--text);
        font-weight: 500;
        font-size: 0.95rem;
    }

/* Toast notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 280px;
    padding: 12px 16px;
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid transparent;
}

.toast-success {
    border-left-color: var(--secondary);
}

.toast-error {
    border-left-color: var(--tertiary);
}

.toast-warning {
    border-left-color: #ffc107;
}

.toast-info {
    border-left-color: var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Compact form layout */
.row.g-4 > [class*="col-"] {
    margin-bottom: 0.75rem;
}

small.text-muted {
    font-size: 0.75rem;
    display: block;
    margin-top: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-xl {
        max-width: 95%;
        margin: 0.5rem auto;
    }

    .modal-body {
        padding: 1rem;
        max-height: 80vh;
    }

    .stats-card {
        grid-template-columns: repeat(2, 1fr);
    }

    .dependents-container {
        grid-template-columns: 1fr;
    }
}
/* Add this to your CSS file */
.id-card-container {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

.plan-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

    .plan-background img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.card-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 86, 179, 0.3);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-logo {
    height: 40px;
    width: auto;
}

.company-name {
    font-size: 20px;
    font-weight: 700;
    color: #0056b3;
    letter-spacing: 0.5px;
}

.africa-badge {
    background-color: #ff6b00;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.tagline {
    text-align: center;
    font-style: italic;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Main Content */
.card-main-content {
    display: flex;
    gap: 25px;
    flex: 1;
    margin-bottom: 20px;
}

.photo-section {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.passport-photo {
    width: 120px;
    height: 150px;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.plan-badge {
    background-color: #0056b3;
    color: white;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
}

.details-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
}

.detail-label {
    flex: 0 0 110px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.detail-value {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

/* Footer */
.card-footer-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 86, 179, 0.3);
}

.emergency-contact {
    font-size: 12px;
    color: #666;
}

    .emergency-contact i {
        color: #ff6b00;
        margin-right: 5px;
    }

.card-type {
    background-color: #ff6b00;
    color: white;
    padding: 3px 15px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .card-main-content {
        flex-direction: column;
        align-items: center;
    }

    .photo-section {
        flex: 0 0 auto;
    }

    .detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .detail-label {
        flex: none;
    }
}