/**
 * KALKI AVATAR - EXTENDED COMPONENT LIBRARY
 * Additional components for multi-service platform
 * Extends: design-system.css
 */

/* =====================================================
   MODULE COLOR TOKENS
   ===================================================== */
:root {
    /* Module-specific accent colors */
    --module-marketplace: #f97316;
    --module-marketplace-light: rgba(249, 115, 22, 0.15);
    --module-work: #0ea5e9;
    --module-work-light: rgba(14, 165, 233, 0.15);
    --module-marriage: #ec4899;
    --module-marriage-light: rgba(236, 72, 153, 0.15);
    --module-identity: #6366f1;
    --module-identity-light: rgba(99, 102, 241, 0.15);

    /* Trust indicators */
    --trust-verified: #10b981;
    --trust-verified-bg: rgba(16, 185, 129, 0.15);
    --trust-premium: #f59e0b;
    --trust-premium-bg: rgba(245, 158, 11, 0.15);
    --trust-new: #8b5cf6;
    --trust-new-bg: rgba(139, 92, 246, 0.15);
}


/* =====================================================
   STEPPER COMPONENT
   ===================================================== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: var(--spacing-md) 0;
}

.stepper-item {
    display: flex;
    align-items: center;
    position: relative;
}

.stepper-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.stepper-item.pending .stepper-circle {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.stepper-item.active .stepper-circle {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.stepper-item.complete .stepper-circle {
    background: var(--success);
    color: white;
}

.stepper-line {
    width: 60px;
    height: 3px;
    background: var(--border);
    margin: 0 var(--spacing-xs);
}

.stepper-item.complete+.stepper-line,
.stepper-item.complete .stepper-line {
    background: var(--success);
}

/* Vertical Stepper */
.stepper.vertical {
    flex-direction: column;
    align-items: flex-start;
}

.stepper.vertical .stepper-item {
    flex-direction: column;
    align-items: flex-start;
}

.stepper.vertical .stepper-line {
    width: 3px;
    height: 40px;
    margin: var(--spacing-xs) 0 var(--spacing-xs) 14px;
}


/* =====================================================
   OTP INPUT COMPONENT
   ===================================================== */
.otp-container {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.otp-input.error {
    border-color: var(--danger);
    animation: shake 0.3s ease;
}

.otp-input.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}


/* =====================================================
   PASSWORD STRENGTH INDICATOR
   ===================================================== */
.password-strength {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 2px;
    transition: background var(--transition-fast);
}

.password-strength[data-strength="weak"] .strength-bar:nth-child(1) {
    background: var(--danger);
}

.password-strength[data-strength="fair"] .strength-bar:nth-child(-n+2) {
    background: var(--warning);
}

.password-strength[data-strength="good"] .strength-bar:nth-child(-n+3) {
    background: #84cc16;
}

.password-strength[data-strength="strong"] .strength-bar {
    background: var(--success);
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 50px;
}


/* =====================================================
   AVATAR COMPONENT
   ===================================================== */
.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.avatar-md {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

.avatar-xl {
    width: 120px;
    height: 120px;
    font-size: 2rem;
}

/* Avatar Badge */
.avatar-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.avatar-badge.online {
    background: var(--success);
}

.avatar-badge.offline {
    background: var(--text-muted);
}

.avatar-badge.verified {
    background: var(--primary);
    width: 16px;
    height: 16px;
}

.avatar-badge.verified::after {
    content: '✓';
    font-size: 10px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


/* =====================================================
   TRUST BADGES
   ===================================================== */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.trust-badge-verified {
    background: var(--trust-verified-bg);
    color: var(--trust-verified);
}

.trust-badge-premium {
    background: var(--trust-premium-bg);
    color: var(--trust-premium);
}

.trust-badge-new {
    background: var(--trust-new-bg);
    color: var(--trust-new);
}


/* =====================================================
   PRODUCT CARD
   ===================================================== */
.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.product-card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-wishlist {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.product-card-wishlist:hover {
    background: white;
    transform: scale(1.1);
}

.product-card-wishlist.active {
    background: var(--danger);
    color: white;
}

.product-card-badges {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card-body {
    padding: var(--spacing-md);
}

.product-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
}

.product-card-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
}


/* =====================================================
   PROFILE CARD (Marriage)
   ===================================================== */
.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.profile-card:hover {
    border-color: var(--module-marriage);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.15);
}

.profile-card-image {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.profile-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.profile-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.profile-card-info {
    font-size: 0.85rem;
    opacity: 0.9;
}

.profile-card-actions {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-xs);
}

.profile-card-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.profile-card-action:hover {
    transform: scale(1.1);
}

.profile-card-action.interest {
    background: var(--module-marriage);
    color: white;
}


/* =====================================================
   JOB CARD
   ===================================================== */
.job-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.job-card:hover {
    border-color: var(--module-work);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.1);
}

.job-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.job-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--module-work-light);
    color: var(--module-work);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.job-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.job-card-company {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.job-card-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.job-card-salary {
    font-size: 1rem;
    font-weight: 600;
    color: var(--success);
}

.job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}


/* =====================================================
   ID CARD PREVIEW
   ===================================================== */
.id-card {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1.586;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.id-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.id-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.id-card-logo {
    width: 40px;
    height: 40px;
}

.id-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.id-card-subtitle {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
}

.id-card-body {
    display: flex;
    gap: var(--spacing-lg);
}

.id-card-photo {
    width: 90px;
    height: 110px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.id-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.id-card-details {
    flex: 1;
}

.id-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.id-card-field {
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.id-card-field-label {
    opacity: 0.6;
    text-transform: uppercase;
    font-size: 0.65rem;
}

.id-card-field-value {
    font-weight: 500;
}

.id-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: var(--spacing-md);
}

.id-card-qr {
    width: 60px;
    height: 60px;
    background: white;
    padding: 4px;
    border-radius: 4px;
}

.id-card-validity {
    text-align: right;
    font-size: 0.7rem;
}


/* =====================================================
   FILTER PANEL
   ===================================================== */
.filter-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.filter-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

/* Price Range Slider */
.range-slider {
    position: relative;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin: var(--spacing-lg) 0;
}

.range-slider-track {
    position: absolute;
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.range-slider-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: box-shadow var(--transition-fast);
}

.range-slider-thumb:hover,
.range-slider-thumb:active {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Checkbox Filter */
.filter-checkbox {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.filter-checkbox-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.filter-checkbox-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filter-checkbox-count {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* =====================================================
   SKELETON LOADER
   ===================================================== */
.skeleton {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: var(--spacing-sm);
}

.skeleton-text.sm {
    height: 0.8rem;
}

.skeleton-text.lg {
    height: 1.5rem;
}

.skeleton-avatar {
    border-radius: 50%;
}

.skeleton-card {
    border-radius: var(--radius-lg);
}


/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state-description {
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}


/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 420px;
    animation: toast-slide-in 0.3s ease;
}

@keyframes toast-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: var(--trust-verified-bg);
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.toast.warning .toast-icon {
    background: var(--trust-premium-bg);
    color: var(--warning);
}

.toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    margin: -4px;
}


/* =====================================================
   MODAL COMPONENT
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    animation: modal-fade 0.2s ease;
}

@keyframes modal-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modal-scale 0.3s ease;
}

@keyframes modal-scale {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-sm {
    max-width: 400px;
}

.modal-md {
    max-width: 560px;
}

.modal-lg {
    max-width: 720px;
}

.modal-xl {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
}


/* =====================================================
   RESPONSIVE UTILITIES
   ===================================================== */
@media (max-width: 768px) {
    .stepper {
        gap: 0;
    }

    .stepper-line {
        width: 30px;
    }

    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }

    .product-card-body {
        padding: var(--spacing-sm);
    }

    .product-card-price {
        font-size: 1.1rem;
    }

    .job-card {
        padding: var(--spacing-md);
    }

    .filter-panel {
        padding: var(--spacing-md);
    }

    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
        top: auto;
        bottom: var(--spacing-lg);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 85vh;
    }
}