/**
 * Token Widget Styles (MDRNDME & PCC)
 * Enhanced trading widget with live price and calculator
 */

/* Price update animation */
@keyframes priceUpdate {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.price-updated {
    animation: priceUpdate 0.5s ease-in-out;
}

/* Token Tickers Container */
.token-tickers {
    display: flex;
    gap: 15px;
}

/* Ticker base styling */
.pcc-ticker {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-glass);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.mdrndme-ticker:hover,
.pcc-ticker:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* PCC specific styling */
.pcc-ticker .ticker-price {
    font-size: 0.9em;
}

/* Expanded Widget Modal */
.mdrndme-widget-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--accent-purple, #8B5CF6);
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(139, 92, 246, 0.3);
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.mdrndme-widget-content {
    padding: 30px;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
}

.widget-header h3 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: 1px;
}

.widget-close {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary, #fff);
    font-size: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.widget-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #8B5CF6;
    transform: rotate(90deg);
}

/* Stats Section */
.widget-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 5px;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
}

/* Calculator Section */
.widget-calculator {
    background: rgba(139, 92, 246, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.widget-calculator h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.calc-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
    color: var(--text-primary, #fff);
    font-size: 16px;
    transition: all 0.3s ease;
}

.calc-row input:focus {
    outline: none;
    border-color: #8B5CF6;
    background: rgba(255, 255, 255, 0.15);
}

.calc-row span {
    font-size: 20px;
    color: var(--text-muted, #8a8a8a);
}

.calc-result {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    color: #8B5CF6;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.calc-note {
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
    text-align: center;
}

/* Action Buttons */
.widget-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.buy-button, .info-button {
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.buy-button.primary {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
}

.buy-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.info-button {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #8B5CF6;
}

/* Widget Info */
.widget-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
    line-height: 1.8;
}

.widget-info p {
    margin: 0;
}

.widget-info strong {
    color: var(--text-primary, #fff);
    font-weight: 600;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mdrndme-widget-modal {
        width: 95%;
        max-width: none;
    }

    .mdrndme-widget-content {
        padding: 20px;
    }

    .widget-header h3 {
        font-size: 22px;
    }

    .widget-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .calc-row {
        flex-direction: column;
        gap: 8px;
    }

    .calc-row input,
    .calc-result {
        width: 100%;
    }

    .calc-row span {
        transform: rotate(90deg);
    }
}

/* PCC Widget Specific Styles */
.widget-alert {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.widget-alert strong {
    color: #ffc107;
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.widget-alert p {
    color: var(--text-muted, #8a8a8a);
    font-size: 14px;
    margin: 0;
}

.widget-next-steps {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.widget-next-steps h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-next-steps ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-muted, #8a8a8a);
    font-size: 13px;
    line-height: 1.8;
}

.widget-next-steps li {
    margin-bottom: 5px;
}

/* Data Source Badge */
.data-source-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #8B5CF6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    text-align: center;
}

/* Price Change Indicators */
.stat-value.positive {
    color: #22c55e !important;
}

.stat-value.negative {
    color: #ef4444 !important;
}

/* PCC Specific Widget Content */
.pcc-widget-content {
    padding: 30px;
}

/* Direct Buy Section */
.direct-buy-section {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.direct-buy-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0 0 15px 0;
    text-align: center;
}

.price-comparison {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.price-box.creator-price {
    border-color: rgba(139, 92, 246, 0.4);
}

.price-box.market-price {
    border-color: rgba(255, 255, 255, 0.2);
}

.price-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #8a8a8a);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.price-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 5px;
}

.price-usd {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
}

.buy-direct-calculator {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.buy-direct-calculator label {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
    margin-bottom: 8px;
}

.buy-direct-calculator input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
    color: var(--text-primary, #fff);
    font-size: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.buy-direct-calculator input:focus {
    outline: none;
    border-color: #8B5CF6;
    background: rgba(255, 255, 255, 0.15);
}

.buy-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.buy-total span {
    font-size: 14px;
}

.total-pol {
    font-weight: 600;
    color: #8B5CF6;
}

.total-usd {
    color: var(--text-muted, #8a8a8a);
}

.buy-direct-btn {
    width: 100%;
}

.direct-buy-note {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted, #8a8a8a);
    margin-top: 10px;
}

/* Dark mode overrides (if needed) */
@media (prefers-color-scheme: dark) {
    .mdrndme-widget-modal {
        background: linear-gradient(135deg, #0a0a14 0%, #0d1117 100%);
    }
}
