/* 
   AstroBhagya Reusable Astrologer Card Component 
   Fully namespaced and isolated.
*/

:root {
    /* Colors */
    --astro-color-surface: #ffffff;
    --astro-color-surface-muted: #f9fafb;
    --astro-color-text-primary: #111827; 
    --astro-color-text-secondary: #6b7280; 
    --astro-color-brand-primary: #F48C06; 
    --astro-color-brand-hover: #E85D04;
    
    /* Status Colors */
    --astro-status-online: #10b981;
    --astro-status-busy: #f59e0b;
    --astro-status-offline: #9ca3af;

    /* Spacing & Geometry */
    --astro-spacing-xs: 4px;
    --astro-spacing-sm: 8px;
    --astro-spacing-md: 16px;
    --astro-spacing-lg: 24px;
    
    --astro-radius-card: 16px;
    --astro-radius-badge: 6px;
    --astro-avatar-size: 84px;
    --astro-avatar-size-sm: 56px;

    /* Elevation */
    --astro-shadow-base: 0 2px 8px rgba(0,0,0,0.04);
    --astro-shadow-hover: 0 12px 24px rgba(0,0,0,0.08);
    
    /* Typography */
    --astro-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base Wrapper */
.astro-card-wrapper {
    background-color: var(--astro-color-surface);
    border-radius: var(--astro-radius-card);
    box-shadow: var(--astro-shadow-base);
    padding: var(--astro-spacing-md);
    font-family: var(--astro-font-family);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
    border: 1px solid #f3f4f6; /* Very subtle border */
}

.astro-card-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: var(--astro-shadow-hover);
}

/* Header Area (Status & Badges) */
.astro-card-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--astro-spacing-sm);
    margin-bottom: var(--astro-spacing-xs);
    z-index: 2;
}

.astro-card-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--astro-radius-badge);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.astro-card-badge-discount {
    background-color: #fee2e2;
    color: #dc2626;
}

.astro-card-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--astro-radius-badge);
    display: flex;
    align-items: center;
    gap: 4px;
}

.astro-card-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.astro-card-status-online {
    background-color: #d1fae5;
    color: #065f46;
}
.astro-card-status-online::before {
    background-color: var(--astro-status-online);
}

.astro-card-status-busy {
    background-color: #fef3c7;
    color: #92400e;
}
.astro-card-status-busy::before {
    background-color: var(--astro-status-busy);
}

.astro-card-status-offline {
    background-color: #f3f4f6;
    color: #374151;
}
.astro-card-status-offline::before {
    background-color: var(--astro-status-offline);
}

/* Body (Image + Info) */
.astro-card-body {
    display: flex;
    gap: var(--astro-spacing-md);
    margin-bottom: var(--astro-spacing-md);
}

/* Avatar */
.astro-card-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.astro-card-avatar {
    width: var(--astro-avatar-size);
    height: var(--astro-avatar-size) !important;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f9fafb;
    background-color: #f3f4f6;
}

/* Status Indicator on Avatar (Optional/Redundant, keeping clean) */
.astro-card-avatar-status {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--astro-color-surface);
}

.astro-card-avatar-status-online { background-color: var(--astro-status-online); }
.astro-card-avatar-status-busy { background-color: var(--astro-status-busy); }
.astro-card-avatar-status-offline { background-color: var(--astro-status-offline); }

/* Info Section */
.astro-card-info {
    flex-grow: 1;
    min-width: 0; /* allows truncation */
}

.astro-card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.astro-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--astro-color-text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.astro-card-name:hover {
    color: var(--astro-color-brand-primary);
}

.astro-card-verified-icon {
    color: #3b82f6; /* Official blue */
    font-size: 14px;
    flex-shrink: 0;
}

.astro-card-rating-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    margin-bottom: 6px;
}

.astro-card-rating-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background-color: #fef3c7; /* Subtle yellow bg */
    border: 1px solid #fde68a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: #92400e;
    font-weight: 700;
    margin-top: 8px;
}

.astro-card-rating-star {
    color: var(--astro-color-brand-primary);
}

.astro-card-rating-score {
    font-weight: 600;
    color: var(--astro-color-text-primary);
}

.astro-card-rating-count {
    color: var(--astro-color-text-secondary);
}

.astro-card-skills {
    font-size: 13px;
    font-weight: 500;
    color: var(--astro-color-text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.astro-card-details {
    font-size: 12px;
    color: var(--astro-color-text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
}

.astro-card-details-divider {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: #d1d5db;
}

/* Pricing Section */
.astro-card-pricing {
    background-color: var(--astro-color-surface-muted);
    border-radius: 8px;
    padding: var(--astro-spacing-sm) var(--astro-spacing-md);
    margin-bottom: var(--astro-spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.astro-card-pricing-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.astro-card-pricing-icon {
    color: var(--astro-color-text-secondary);
    font-size: 12px;
}

.astro-card-price-label {
    font-size: 12px;
    color: var(--astro-color-text-secondary);
}

.astro-card-price-strike {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

.astro-card-price-final {
    font-size: 15px;
    font-weight: 700;
    color: var(--astro-color-text-primary);
}

.astro-card-pricing-promo {
    font-size: 11px;
    font-weight: 600;
    color: #059669; /* Green */
}

/* Action Buttons */
.astro-card-actions {
    display: flex;
    gap: var(--astro-spacing-sm);
    margin-top: auto; /* pushes buttons to bottom */
}

.astro-card-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.astro-card-btn i {
    font-size: 14px;
}

.astro-card-btn-primary {
    background-color: var(--astro-color-brand-primary);
    color: #ffffff !important;
}

.astro-card-btn-primary:hover {
    background-color: var(--astro-color-brand-hover);
    text-decoration: none;
}

.astro-card-btn-outline {
    background-color: transparent;
    border: 1px solid var(--astro-color-brand-primary);
    color: var(--astro-color-brand-primary) !important;
}

.astro-card-btn-outline:hover {
    background-color: #fff7ed; /* Light orange */
    text-decoration: none;
}

.astro-card-btn-disabled {
    background-color: #f3f4f6;
    color: #9ca3af !important;
    cursor: not-allowed;
    border: none;
}

.astro-card-btn-disabled:hover {
    background-color: #9ca3af;
    color: #ffffff !important;
}

/* Layout Variants */
/* Compact Layout */
.astro-card-layout-compact {
    padding: var(--astro-spacing-sm);
}

.astro-card-layout-compact .astro-card-avatar {
    width: var(--astro-avatar-size-sm);
    height: var(--astro-avatar-size-sm);
}

.astro-card-layout-compact .astro-card-name {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .astro-card-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .astro-card-btn {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .astro-card-btn i {
        font-size: 12px;
    }
    
    .astro-card-pricing {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
    }
}

/* Wrapper for horizontal scroll implementation */
.astro-card-scroll-item {
    width: 340px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .astro-card-scroll-item {
        width: 270px; /* Allow next card to peek in on mobile */
    }
}
