/**
 * Vending Machine Widget Styles
 * Token purchase interface with wallet integration
 */

/* Vending Modal Overlay */
.vending-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

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

/* Vending Modal Content */
.vending-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--accent-purple, #8B5CF6);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 40px rgba(139, 92, 246, 0.3);
    animation: slideInVending 0.3s ease-out;
}

@keyframes slideInVending {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Vending Modal Inner Content */
.vending-modal-inner {
    padding: 30px;
}

/* Vending Header */
.vending-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);
}

.vending-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;
}

.vending-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;
}

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

/* Vending Info Section */
.vending-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.vending-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vending-stat:last-child {
    border-bottom: none;
}

.vending-label {
    font-size: 14px;
    color: var(--text-muted, #8a8a8a);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.vending-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.vending-value.available {
    color: #22c55e;
}

.vending-value.empty {
    color: #ef4444;
}

/* Vending Connect Section */
.vending-connect {
    text-align: center;
    padding: 40px 20px;
}

.vending-connect p {
    color: var(--text-muted, #8a8a8a);
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Vending Calculator */
.vending-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);
}

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

.calc-input-group {
    margin-bottom: 20px;
}

.calc-input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted, #8a8a8a);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.calc-input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    color: var(--text-primary, #fff);
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.calc-input-group input:focus {
    outline: none;
    border-color: #8B5CF6;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.calc-input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Calculator Result */
.calc-result {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
}

.calc-result-label {
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 600;
}

.calc-result-value {
    font-size: 28px;
    font-weight: 700;
    color: #8B5CF6;
    margin-bottom: 8px;
}

.calc-result-usd {
    font-size: 14px;
    color: var(--text-muted, #8a8a8a);
}

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

/* Vending Buttons */
.vending-button {
    width: 100%;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

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

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

.vending-button.primary:active:not(:disabled) {
    transform: translateY(0);
}

.vending-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vending-button.purchase-btn {
    margin-top: 10px;
}

/* Status Messages */
.vending-status {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-primary, #fff);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.vending-status:empty {
    display: none;
}

.vending-status.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.vending-status.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.vending-status.loading {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: #8B5CF6;
}

/* Vending Footer */
.vending-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
    line-height: 1.8;
    margin-top: 20px;
}

.vending-footer p {
    margin: 5px 0;
}

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

.vending-footer a {
    color: #8B5CF6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.vending-footer a:hover {
    color: #EC4899;
    text-decoration: underline;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.vending-button:disabled {
    animation: pulse 2s ease-in-out infinite;
}

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

    .vending-modal-inner {
        padding: 20px;
    }

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

    .vending-close {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }

    .vending-calculator {
        padding: 15px;
    }

    .calc-result-value {
        font-size: 24px;
    }

    .vending-button {
        padding: 14px 20px;
        font-size: 14px;
    }
}

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

/* Scrollbar Styling for Modal */
.vending-modal-content::-webkit-scrollbar {
    width: 8px;
}

.vending-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.vending-modal-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 10px;
}

.vending-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}
