/* Premium styling for ICON Lybrary */

:root {
    --premium-gold: #f59e0b;
    --premium-gold-dark: #d97706;
    --premium-purple: #8b5cf6;
    --premium-purple-dark: #6d28d9;
    --premium-gradient: linear-gradient(135deg, #8b5cf6, #ec4899);
    --premium-gold-gradient: linear-gradient(135deg, #ffd700, #f59e0b);
}

/* User Profile Header */
.user-profile-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem 0.4rem 0.5rem;
    border-radius: 99px;
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.user-profile-btn.is-premium .user-avatar {
    border-color: var(--premium-gold);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    text-align: left;
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    line-height: 1.2;
}

.badge-free {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-premium {
    background: var(--premium-gold-gradient);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-100);
    z-index: 1000;
    padding: 1rem;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.user-dropdown.show {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 0.75rem;
}

.dropdown-email {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-status {
    font-size: 0.8rem;
    color: var(--gray-700);
    font-weight: 500;
    margin-top: 0.25rem;
}

.dropdown-status span.expiry-date {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 400;
}

.dropdown-counter-group {
    background: var(--gray-50);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.counter-label {
    color: var(--gray-600);
}

.counter-value {
    font-weight: 600;
    color: var(--blue-primary);
}

.dropdown-btn {
    width: 100%;
    padding: 0.6rem;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.btn-upgrade {
    background: var(--premium-gradient);
    color: white;
}

.btn-upgrade:hover {
    filter: brightness(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-logout {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-logout:hover {
    background: var(--gray-200);
}

/* Download Counter Floating Widget */
.download-limit-badge {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 99px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.download-limit-badge i {
    color: var(--premium-gold);
}

.download-limit-badge .limit-number {
    color: var(--blue-primary);
    font-weight: 700;
}

/* Premium Modal Layout */
.premium-modal-content {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    text-align: center;
    max-width: 900px;
    width: 100%;
    margin: 0 auto; /* Center modal content */
}

.premium-modal-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    background: var(--premium-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2rem;
}

.premium-modal-header p {
    color: var(--gray-600);
    font-size: 0.8rem;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.pricing-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.15rem 1rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.15);
    border-color: var(--premium-purple);
}

.pricing-card.selected {
    border: 2px solid var(--premium-purple);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.25);
    background: linear-gradient(to bottom, #fcfaff, #ffffff);
    padding: 1.0875rem 0.9375rem; /* Compensate for 2px border */
}

.pkg-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%); /* Center badge perfectly */
    background: var(--premium-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 10;
}

/* Blue badge for Saving package */
.pkg-popular-badge.badge-saving {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.pkg-duration {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
}

.pkg-price-row {
    margin: 0.2rem 0;
}

.pkg-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gray-900);
}

.pkg-price-unit {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

.pkg-discount {
    font-size: 0.7rem;
    color: #10b981;
    background: #ecfdf5;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    font-weight: 600;
}

.pricing-radio {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--gray-300);
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.pricing-card.selected .pricing-radio {
    border-color: var(--premium-purple);
    background: var(--premium-purple);
}

.pricing-card.selected .pricing-radio::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* User Email Confirmation Field */
.premium-checkout-info {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.premium-checkout-info label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.checkout-email-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

.checkout-email-input:focus {
    border-color: var(--premium-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Payment Action Button */
.btn-checkout-submit {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background: var(--premium-gradient);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.7rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    transition: all 0.2s ease;
}

.btn-checkout-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.3);
}

.btn-checkout-submit:active {
    transform: translateY(0);
}

.btn-google-register {
    background: #4285F4 !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 0.7rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google-register:hover {
    background: #357ae8 !important;
    box-shadow: 0 6px 18px rgba(66, 133, 244, 0.3) !important;
    transform: translateY(-1px);
}

.btn-google-register img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1); /* Make the SVG logo white to pop */
}

/* QR Code & Billing Layout */
.payment-flow-section {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    justify-content: center;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease-out;
}

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

.qr-code-panel {
    flex: 0 0 210px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qr-image-wrapper {
    background: white;
    padding: 0.4rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.qr-image {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.payment-pulse-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    animation: pulseGlow 1.5s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 6px #f59e0b; }
}

/* Transaction Details */
.billing-details-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.billing-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.billing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.billing-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-item-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

.billing-item-value-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.billing-item-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-800);
}

.billing-item-value.price-highlight {
    color: var(--premium-purple);
}

.btn-copy-billing {
    background: none;
    border: none;
    color: var(--blue-primary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.2rem;
    transition: transform 0.1s ease;
}

.btn-copy-billing:hover {
    transform: scale(1.1);
}

.billing-instructions {
    font-size: 0.7rem;
    color: var(--gray-500);
    line-height: 1.3;
    border-left: 3px solid var(--premium-purple);
    padding-left: 0.5rem;
}

/* Confetti / Success celebration styles */
.payment-success-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    gap: 1rem;
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 0.8; }
    70% { transform: scale(0.9); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.success-icon-wrapper {
    width: 72px;
    height: 72px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.success-message-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
}

.success-message-desc {
    color: var(--gray-600);
    font-size: 0.95rem;
    max-width: 400px;
    line-height: 1.5;
}

.btn-success-close {
    background: #10b981;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.btn-success-close:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    filter: brightness(1.05);
}

/* Loader indicators */
.payment-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    gap: 1rem;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border-left-color: var(--premium-purple);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile responsive for Premium elements */
@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .payment-flow-section {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .qr-code-panel {
        flex: 1 1 auto;
        width: 100%;
    }
    
    .premium-modal-content {
        padding: 1.5rem;
    }
    
    .premium-benefits-section {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Premium Brand Identity Header */
.premium-modal-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.premium-modal-brand i {
    color: var(--blue-primary);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.premium-modal-brand span {
    letter-spacing: 0.05em;
}

/* Price breakdown equivalent text */
.pkg-monthly-equivalent {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: -0.25rem;
}

.pricing-card.selected .pkg-monthly-equivalent {
    color: var(--premium-purple);
    font-weight: 600;
}

/* Section divider */
.modal-divider {
    height: 1px;
    background: var(--gray-100);
    width: 100%;
    margin: 0.25rem 0;
}

/* Premium Benefits list */
.premium-benefits-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1rem;
    text-align: left;
    margin: 0.25rem 0;
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--gray-100);
}

.benefit-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.benefit-item i {
    font-size: 1rem;
    color: #10b981;
    margin-top: 0.15rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.benefit-item h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 0.15rem 0;
}

.benefit-item p {
    font-size: 0.7rem;
    color: var(--gray-500);
    line-height: 1.3;
    margin: 0;
}

/* Trust Badges Footer */
.trust-badges-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 0;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.trust-badge-item i {
    color: var(--blue-primary);
    font-size: 0.85rem;
}

/* Code Snippet Premium Blur Overlay */
.code-content {
    position: relative;
    overflow: hidden;
}

.code-snippet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
}

.code-snippet-overlay.hidden {
    display: none;
    pointer-events: none;
}

.code-snippet-overlay span {
    background: var(--premium-gradient);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.code-snippet-overlay:hover span {
    transform: scale(1.05);
}
