/**
 * Web3 Integration Styles
 * =======================
 * Styles for wallet connection, subscription, and token UI.
 */

/* ═══════════════════════════════════════════
   CSS VARIABLES
   ═══════════════════════════════════════════ */

:root {
    --malk-primary: #6366f1;
    --malk-secondary: #8b5cf6;
    --malk-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --malk-success: #10b981;
    --malk-warning: #f59e0b;
    --malk-error: #ef4444;
    --malk-glass: rgba(255, 255, 255, 0.05);
    --malk-border: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════
   WALLET BUTTON & INFO
   ═══════════════════════════════════════════ */

.wallet-connect-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--malk-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.wallet-connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.wallet-connect-btn:active {
    transform: translateY(0);
}

.wallet-connect-btn .icon {
    font-size: 1.2em;
}

/* Wallet Info Block */
.wallet-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--malk-glass);
    border: 1px solid var(--malk-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.wallet-info.hidden {
    display: none;
}

.wallet-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--malk-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.wallet-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wallet-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #fff;
}

.wallet-balance {
    font-size: 0.75rem;
    color: var(--malk-secondary);
}

.wallet-disconnect {
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wallet-disconnect:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ═══════════════════════════════════════════
   MALK TOKEN BALANCE CARD
   ═══════════════════════════════════════════ */

.malk-balance-card {
    background: var(--malk-glass);
    border: 1px solid var(--malk-border);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.malk-balance-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.malk-logo {
    width: 48px;
    height: 48px;
    background: var(--malk-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.malk-balance-title {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0;
}

.malk-balance-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
}

.malk-balance-usd {
    font-size: 0.85rem;
    color: #6b7280;
}

.malk-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.malk-action-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.malk-action-btn.primary {
    background: var(--malk-gradient);
    border: none;
    color: white;
}

.malk-action-btn.secondary {
    background: transparent;
    border: 1px solid var(--malk-border);
    color: #9ca3af;
}

.malk-action-btn:hover {
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════
   SUBSCRIPTION CARDS
   ═══════════════════════════════════════════ */

.subscription-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.subscription-card {
    background: var(--malk-glass);
    border: 1px solid var(--malk-border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.subscription-card:hover {
    border-color: var(--malk-primary);
    transform: translateY(-4px);
}

.subscription-card.popular {
    border-color: var(--malk-secondary);
}

.subscription-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: 16px;
    right: -32px;
    background: var(--malk-secondary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 40px;
    transform: rotate(45deg);
}

.subscription-card.current {
    border-color: var(--malk-success);
}

.subscription-card.current::after {
    content: '✓ Current';
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--malk-success);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.subscription-tier {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0 0 8px;
}

.subscription-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 16px;
}

.subscription-price .amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--malk-primary);
    font-family: 'JetBrains Mono', monospace;
}

.subscription-price .currency {
    font-size: 1rem;
    color: #9ca3af;
}

.subscription-price .period {
    font-size: 0.85rem;
    color: #6b7280;
}

.subscription-features {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

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

.subscription-features li::before {
    content: '✓';
    color: var(--malk-success);
    font-weight: bold;
}

.subscription-features li.disabled {
    color: #6b7280;
}

.subscription-features li.disabled::before {
    content: '✗';
    color: #6b7280;
}

.subscribe-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--malk-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscribe-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.subscribe-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Duration toggle */
.duration-toggle {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 4px;
    background: var(--malk-glass);
    border-radius: 12px;
    margin-bottom: 24px;
}

.duration-toggle button {
    flex: 1;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.duration-toggle button.active {
    background: var(--malk-gradient);
    color: white;
}

.duration-toggle button:hover:not(.active) {
    color: white;
}

.yearly-savings {
    background: rgba(16, 185, 129, 0.2);
    color: var(--malk-success);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* ═══════════════════════════════════════════
   SUBSCRIPTION STATUS
   ═══════════════════════════════════════════ */

.subscription-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscription-status .badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--malk-success);
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--malk-warning);
}

/* ═══════════════════════════════════════════
   MODAL STYLES
   ═══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: #1f2937;
    border: 1px solid var(--malk-border);
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

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

.modal-content h3 {
    font-size: 1.5rem;
    margin: 0 0 16px;
    color: white;
}

.modal-content p {
    color: #9ca3af;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* Wallet options grid */
.wallet-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.wallet-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--malk-glass);
    border: 1px solid var(--malk-border);
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: all 0.2s ease;
}

.wallet-option:hover {
    border-color: var(--malk-primary);
    background: rgba(99, 102, 241, 0.1);
}

.wallet-option img {
    width: 48px;
    height: 48px;
}

/* Subscription summary */
.subscription-summary {
    background: var(--malk-glass);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--malk-border);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span {
    color: #9ca3af;
}

.summary-item strong {
    color: white;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--malk-gradient);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--malk-glass);
    border: 1px solid var(--malk-border);
    color: #9ca3af;
}

.btn-secondary:hover {
    border-color: #4b5563;
    color: white;
}

/* ═══════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════ */

.hidden {
    display: none !important;
}

.text-muted {
    color: #6b7280;
    font-size: 0.85rem;
}

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

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    .subscription-grid {
        grid-template-columns: 1fr;
    }

    .wallet-info {
        flex-wrap: wrap;
    }

    .duration-toggle {
        flex-direction: column;
    }

    .modal-content {
        padding: 24px;
    }

    .wallet-options {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

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

.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--malk-glass) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--malk-glass) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
