/* Custom Customer Dashboard Styles */

.customer-dashboard {
    background-color: #f5f7fa;
    padding: 2rem 0;
}

/* Profile Card */
.profile-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 600;
}

.profile-info h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    color: #1a202c;
    font-weight: 600;
}

.profile-info p {
    margin: 0;
    color: #718096;
    font-size: 0.95rem;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #e6f7f7;
    color: #00838f;
    border-radius: 20px;
    font-size: 0.875rem;
    border: 1px solid #b2dfdb;
}

.profile-btn {
    width: 100%;
    padding: 0.875rem;
    background: #003f5c;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.profile-btn:hover {
    background: #002a3d;
}

/* Plan Section */
.plan-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.plan-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.plan-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: #718096;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

[data-tab-content] {
    display: none; /* ocultar todo por defecto */
}

[data-tab-content].active {
    display: block; /* mostrar el activo */
}

.plan-tab.active {
    color: #003f5c;
    border-bottom-color: #003f5c;
}

.plan-content h3 {
    font-size: 1.125rem;
    color: #1a202c;
    margin-bottom: 1.5rem;
}

.plan-progress {
    margin-bottom: 2rem;
}

.plan-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.plan-progress-label {
    color: #718096;
    font-size: 0.875rem;
}

.plan-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.plan-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.plan-progress-fill.applied {
    background: #003f5c;
}

.plan-progress-fill.remaining {
    background: #48bb78;
}

/* Claims Card */
.claims-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.claims-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.claims-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1a202c;
}

.view-all-link {
    color: #00bcd4;
    text-decoration: none;
    font-size: 0.875rem;
}

.claims-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.claims-tab {
    padding: 0.5rem 1rem;
    background: #f7fafc;
    border: none;
    border-radius: 6px;
    color: #718096;
    cursor: pointer;
    font-size: 0.875rem;
}

.claims-tab.active {
    background: #1a202c;
    color: white;
}

.claims-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.donut-chart {
    position: relative;
    width: 150px;
    height: 150px;
}

.donut-chart svg {
    transform: rotate(-90deg);
}

.donut-chart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-chart-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

.donut-chart-label {
    font-size: 0.875rem;
    color: #718096;
}

.claims-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.claims-detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.claims-detail-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.claims-detail-dot.paid {
    background: #48bb78;
}

.claims-detail-dot.plan {
    background: #003f5c;
}

.claims-detail-label {
    color: #718096;
    font-size: 0.875rem;
    flex: 1;
}

.claims-detail-amount {
    font-weight: 600;
    color: #1a202c;
}

/* Widget Cards */
.widget-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.125rem;
    color: #1a202c;
    font-weight: 600;
    margin: 0;
}

/* Medication Widget */
.medication-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.medication-stat {
    text-align: center;
}

.medication-stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.medication-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.25rem;
}

.medication-stat-label {
    color: #718096;
    font-size: 0.875rem;
}

.medication-stat-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e6f7f7;
    color: #00838f;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Order Widget */
.order-timeline {
    position: relative;
    padding-left: 2rem;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.order-step {
    position: relative;
    margin-bottom: 1.5rem;
}

.order-step::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #48bb78;
    z-index: 1;
}

.order-step.pending::before {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.order-step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.order-step-title {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.9375rem;
}

.order-step-id {
    color: #718096;
    font-size: 0.75rem;
}

.order-step-time {
    color: #718096;
    font-size: 0.8125rem;
}

.order-step-details {
    color: #718096;
    font-size: 0.8125rem;
}

.order-step-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #fef5e7;
    color: #d68910;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Medication History Table */
.medication-history-table {
    width: 100%;
    border-collapse: collapse;
}

.medication-history-table thead {
    background: #f7fafc;
}

.medication-history-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    color: #718096;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.medication-history-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #1a202c;
    font-size: 0.9375rem;
}

.medication-history-table tbody tr:hover {
    background: #f7fafc;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .plan-tabs {
        flex-wrap: wrap;
    }

    .medication-stats {
        grid-template-columns: 1fr;
    }
}

/* Quick Stats Card */
.quick-stats-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    height: 100%;
}

.quick-stats-card .widget-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.quick-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.quick-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-stat-item:last-child {
    margin-bottom: 0;
}

.quick-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-stat-content {
    flex: 1;
}

.quick-stat-label {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.quick-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
}

/* Ensure proper spacing */
.customer-dashboard [class*="col-"] {
    margin-bottom: 2rem;
}

/* Enhanced Responsive Design */
@media (min-width: 1200px) {
    .customer-dashboard .container {
        max-width: 1400px;
    }
}

@media (max-width: 991px) {
    .medication-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .customer-dashboard {
        padding: 1rem 0;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .donut-chart, .donut-chart svg {
        width: 120px;
        height: 120px;
    }
    
    .quick-stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .quick-stat-icon span {
        font-size: 20px !important;
    }
}

@media (max-width: 576px) {
    .profile-card, .plan-section, .claims-card, 
    .quick-stats-card, .widget-card {
        padding: 1.5rem;
    }
    
    .profile-details {
        grid-template-columns: 1fr;
    }
}

/* Two-row layout: 1/3 + 2/3 */
.customer-dashboard .row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.customer-dashboard .row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

/* Make all cards fill their container height */
.profile-card,
.plan-section,
.quick-stats-card,
.claims-card {
    flex: 1;
    height: 100%;
    margin-bottom: 0;
}

/* Adjust plan section for wider layout */
@media (min-width: 992px) {
    .plan-section .plan-tabs {
        justify-content: flex-start;
    }
    
    .plan-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .plan-content > h3:nth-of-type(1),
    .plan-content > .plan-progress:nth-of-type(1) {
        grid-column: 1;
    }
    
    .plan-content > h3:nth-of-type(2),
    .plan-content > .plan-progress:nth-of-type(2) {
        grid-column: 2;
    }
    
    /* Make claims card content horizontal on wider screens */
    .claims-card {
        display: flex;
        flex-direction: column;
    }
    
    .claims-card .claims-chart {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Responsive adjustments for tablet */
@media (max-width: 991px) {
    .customer-dashboard [class*="col-lg-8"],
    .customer-dashboard [class*="col-lg-4"] {
        margin-bottom: 2rem;
    }
}
