/* Health Insurance Cards - Modern Medical Design */

.health-insurance-container {
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 50vh;
}

/* Header Section */
.health-insurance-header {
    margin-bottom: 32px;
}

.health-insurance-header h4 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 4px;
}

.btn-add-insurance {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.btn-add-insurance:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

/* Insurance Cards Grid */
.insurance-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Individual Insurance Card */
.insurance-card {
    position: relative;
    height: 100%;
}

.insurance-card-inner {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafe 100%);
    border-radius: 18px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.08);
    position: relative;
    height: 100%;
    backdrop-filter: blur(10px);
}

.insurance-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(
        90deg, 
        #3b82f6 0%, 
        #06b6d4 25%, 
        #10b981 50%, 
        #f59e0b 75%, 
        #ef4444 100%
    );
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.insurance-card-inner:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.15);
}

/* Enhanced Primary Plan Styling */
.insurance-card.primary-plan .insurance-card-inner {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 10%, #ffffff 100%);
    border: 2px solid #f59e0b;
    box-shadow: 
        0 8px 32px rgba(245, 158, 11, 0.2),
        0 2px 8px rgba(245, 158, 11, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.insurance-card.primary-plan .insurance-card-inner::before {
    background: linear-gradient(90deg, #f59e0b, #eab308, #fbbf24);
    height: 6px;
}

.insurance-card.primary-plan .insurance-card-inner:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 
        0 25px 50px rgba(245, 158, 11, 0.25),
        0 10px 20px rgba(245, 158, 11, 0.15);
}

/* Card Header */
.insurance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.insurance-icon {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
}

.insurance-icon::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 12px;
    pointer-events: none;
}

.insurance-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.btn-action:hover {
    background: #f8f9fa;
    color: #495057;
    transform: scale(1.1);
}

.btn-delete:hover {
    background: #fff5f5;
    color: #e53e3e;
}

.btn-edit:hover {
    background: #f0f8ff;
    color: #2196F3;
}

/* Card Body */
.insurance-card-body {
    padding: 20px 24px 24px;
}

.insurance-name {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    line-height: 1.3;
}

.insurance-details {
    margin-bottom: 20px;
}

.insurance-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

.insurance-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.detail-label i {
    color: #2196F3;
    width: 16px;
}

.detail-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.insurance-number {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
}

/* Status Badge */
.insurance-status {
    display: flex;
    justify-content: flex-end;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #e8f5e8;
    color: #2e7d2e;
}

/* Empty State */
.insurance-empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40vh;
}

.empty-state-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #1976d2;
    font-size: 32px;
}

.empty-state-content h5 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 18px;
}

.empty-state-content p {
    color: #6c757d;
    margin-bottom: 24px;
    line-height: 1.6;
}

.empty-state-content .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
}

/* Modal Improvements */
.modal-content {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: #fff;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-weight: 600;
    font-size: 18px;
}

.btn-close {
    background: none;
    border: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.btn-close:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .health-insurance-container {
        padding: 16px;
    }
    
    .health-insurance-header {
        margin-bottom: 24px;
    }
    
    .health-insurance-header .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .health-insurance-header .btn-add-insurance {
        width: 100%;
        justify-content: center;
    }
    
    .insurance-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .insurance-card-inner {
        border-radius: 12px;
    }
    
    .insurance-card-header,
    .insurance-card-body {
        padding: 16px 20px;
    }
    
    .insurance-card-body {
        padding-top: 12px;
    }
    
    .insurance-name {
        font-size: 18px;
    }
    
    .empty-state-content {
        padding: 24px 20px;
    }
    
    .empty-state-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .insurance-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 0;
    }
    
    .detail-value {
        font-size: 16px;
        align-self: flex-end;
    }
    
    .modal-dialog {
        margin: 16px;
    }
}

/* Animation for card entry */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.insurance-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.insurance-card:nth-child(1) { animation-delay: 0.1s; }
.insurance-card:nth-child(2) { animation-delay: 0.2s; }
.insurance-card:nth-child(3) { animation-delay: 0.3s; }
.insurance-card:nth-child(4) { animation-delay: 0.4s; }

/* Accessibility improvements */
.btn-action:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

.insurance-card-inner:focus-within {
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.3);
}

/* Inline Edit Styles */
.card-editing {
    background: #f8f9ff !important;
    border: 2px solid #2196F3 !important;
}

.card-editing .insurance-name {
    margin-bottom: 8px;
}

.inline-edit-form {
    display: none;
}

.inline-edit-form.active {
    display: block;
}

.inline-edit-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    background: white;
    transition: border-color 0.2s ease;
}

.inline-edit-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.inline-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.inline-edit-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-save-edit {
    background: #4CAF50;
    color: white;
}

.btn-save-edit:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.btn-cancel-edit {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #ddd;
}

.btn-cancel-edit:hover {
    background: #e9ecef;
    color: #495057;
}

.editing-mode .detail-value {
    display: none;
}

.editing-mode .inline-edit-form {
    display: block;
}

.edit-highlight {
    background: linear-gradient(45deg, transparent 40%, rgba(33, 150, 243, 0.1) 50%, transparent 60%);
    animation: highlightSweep 2s ease-in-out;
}

@keyframes highlightSweep {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* Status Badge Variations */
.status-inactive {
    background: #ffeaa7;
    color: #d63031;
}

.status-expired {
    background: #fab1a0;
    color: #e17055;
}

.status-pending {
    background: #74b9ff;
    color: white;
}

/* Validity Alert Styles */
.validity-alert {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.validity-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.validity-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.validity-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Favorite/Primary Insurance Styles */
.insurance-card.primary-plan {
    position: relative;
}

.insurance-card.primary-plan .insurance-card-inner {
    border: 2px solid #FFD700;
    background: linear-gradient(135deg, #fffbf0 0%, #ffffff 100%);
}

.insurance-card.primary-plan .insurance-card-inner::before {
    background: linear-gradient(90deg, #FFD700, #FFA500, #FF8C00);
    height: 5px;
}

.primary-badge {
    position: absolute;
    top: -8px;
    right: 16px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #8B4513;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    z-index: 10;
}

.btn-favorite {
    color: #6c757d;
    transition: all 0.2s ease;
}

.btn-favorite:hover {
    color: #FFD700;
    background: #fffbf0;
}

.btn-favorite.active {
    color: #FFD700;
}

.btn-favorite.active:hover {
    color: #FFA500;
    background: #fff8e1;
}

/* Additional Information Styles */
.insurance-extra-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    border-left: 3px solid #2196F3;
}

.extra-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}

.extra-info-label {
    color: #6c757d;
    font-weight: 500;
}

.extra-info-value {
    color: #2c3e50;
    font-weight: 600;
}

/* Print styles */
@media print {
    .insurance-actions,
    .btn-add-insurance {
        display: none !important;
    }
    
    .insurance-card-inner {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .insurance-cards-grid {
        display: block;
    }
    
    .insurance-card {
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .inline-edit-form,
    .inline-edit-actions {
        display: none !important;
    }
}