/**
 * Session Credits - Premium UI Styles
 * Modern, glassmorphic design with smooth animations
 */

/* ============================================
   SESSION BALANCE WIDGET
   ============================================ */

.session-balance-widget {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(18, 140, 126, 0.1) 100%);
    border: 2px solid rgba(37, 211, 102, 0.3);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.session-balance-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.1) 0%, transparent 70%);
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.session-balance-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.2);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.balance-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-title::before {
    content: '💳';
    font-size: 1.5rem;
}

.balance-stats {
    display: flex;
    align-items: baseline;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.balance-current {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.balance-total {
    font-size: 1.5rem;
    color: #999;
    font-weight: 500;
}

.balance-expiry {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.balance-expiry::before {
    content: '⏰';
    font-size: 1.1rem;
}

.balance-expiry.expired {
    color: #dc3545;
    font-weight: 600;
}

.balance-expiry.expired::before {
    content: '⚠️';
}

.balance-progress {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
    position: relative;
    z-index: 1;
}

.balance-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #25D366 0%, #128C7E 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.balance-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.balance-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.btn-buy-sessions {
    flex: 1;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-buy-sessions::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-buy-sessions:hover::before {
    width: 300px;
    height: 300px;
}

.btn-buy-sessions:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.btn-view-history {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    border: 2px solid #25D366;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-history:hover {
    background: #25D366;
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   PACKAGES GRID
   ============================================ */

.packages-container {
    margin-top: 30px;
}

.packages-header {
    text-align: center;
    margin-bottom: 40px;
}

.packages-header h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.packages-header p {
    color: #666;
    font-size: 1.1rem;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.package-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #25D366 0%, #128C7E 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.package-card:hover::before {
    transform: scaleX(1);
}

.package-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(37, 211, 102, 0.2);
    border-color: #25D366;
}

.package-card.popular {
    border-color: #25D366;
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.25);
}

.package-card.popular::after {
    content: '⭐ Most Popular';
    position: absolute;
    top: 20px;
    right: -35px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 5px 40px;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(45deg);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.package-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.package-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    min-height: 40px;
}

.package-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}

.price-amount {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-currency {
    font-size: 1.2rem;
    color: #999;
    font-weight: 600;
}

.package-details {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.05) 0%, rgba(18, 140, 126, 0.05) 100%);
    border-radius: 12px;
}

.package-detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #333;
}

.package-detail-item:last-child {
    margin-bottom: 0;
}

.package-detail-item::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.package-features {
    margin-bottom: 25px;
}

.package-features ul {
    list-style: none;
    padding: 0;
}

.package-features li {
    padding: 8px 0;
    color: #666;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.package-features li::before {
    content: '✓';
    color: #25D366;
    font-weight: 700;
    font-size: 1.1rem;
}

.btn-select-package {
    width: 100%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-select-package::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-select-package:hover::before {
    width: 400px;
    height: 400px;
}

.btn-select-package:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

.btn-select-package:active {
    transform: translateY(0);
}

/* ============================================
   PURCHASE FORM MODAL
   ============================================ */

.purchase-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.purchase-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.purchase-modal-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.purchase-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.purchase-modal-header h3 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.selected-package-summary {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(18, 140, 126, 0.1) 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid rgba(37, 211, 102, 0.3);
}

.selected-package-summary h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.summary-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #25D366;
}

.payment-method-selector {
    margin-bottom: 25px;
}

.payment-method-selector label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
    font-size: 1.05rem;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.payment-method-option {
    position: relative;
}

.payment-method-option input[type="radio"] {
    display: none;
}

.payment-method-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.payment-method-option input[type="radio"]:checked + .payment-method-label {
    border-color: #25D366;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(18, 140, 126, 0.1) 100%);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
}

.payment-method-icon {
    font-size: 2.5rem;
}

.payment-method-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.file-upload-area {
    margin-top: 25px;
    padding: 30px;
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-upload-area:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.05);
}

.file-upload-area.dragover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #999;
}

.upload-text {
    color: #666;
    font-size: 1rem;
    margin-bottom: 8px;
}

.upload-subtext {
    color: #999;
    font-size: 0.85rem;
}

.file-preview-container {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    display: none;
}

.file-preview-container.show {
    display: block;
}

.file-preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.btn-remove-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-remove-file:hover {
    background: #c82333;
}

.purchase-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-submit-purchase {
    flex: 1;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-submit-purchase:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.btn-submit-purchase:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-cancel-purchase {
    background: #6c757d;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel-purchase:hover {
    background: #5a6268;
}

/* ============================================
   PURCHASE HISTORY
   ============================================ */

.purchase-history-container {
    margin-top: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.history-header h3 {
    font-size: 1.8rem;
    color: #333;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
}

.filter-btn.active {
    border-color: #25D366;
    background: #25D366;
    color: white;
}

.filter-btn:hover {
    border-color: #25D366;
}

.purchase-requests-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.purchase-request-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #e0e0e0;
}

.purchase-request-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.purchase-request-card.pending {
    border-left-color: #ffc107;
}

.purchase-request-card.approved {
    border-left-color: #28a745;
}

.purchase-request-card.rejected {
    border-left-color: #dc3545;
}

.purchase-request-card.cancelled {
    border-left-color: #6c757d;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.request-ref {
    font-size: 0.9rem;
    color: #999;
    font-weight: 600;
}

.request-status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.request-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.request-status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.request-status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.request-status-badge.cancelled {
    background: #e2e3e5;
    color: #383d41;
}

.request-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.request-detail {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.request-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-cancel-request {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel-request:hover {
    background: #c82333;
}

.btn-view-proof {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view-proof:hover {
    background: #138496;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        grid-template-columns: 1fr;
    }
    
    .summary-details {
        grid-template-columns: 1fr;
    }
    
    .purchase-form-actions {
        flex-direction: column;
    }
    
    .balance-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .request-details {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

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

.skeleton-package {
    height: 400px;
}

.skeleton-request {
    height: 150px;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

.empty-state-text {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
}
