/* Cyberpunk Dark Theme for Carbon Credit Trading DApp */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-cyan: #00ffff;
    --primary-magenta: #ff0080;
    --primary-yellow: #ffff00;
    --primary-green: #00ff41;
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --bg-card: #151520;
    --bg-card-hover: #1f1f35;
    --text-primary: #ffffff;
    --text-secondary: #b4b4d1;
    --text-accent: #00ffff;
    --border-glow: #00ffff40;
    --shadow-glow: 0 0 20px rgba(0, 255, 255, 0.3);
    --shadow-glow-pink: 0 0 20px rgba(255, 0, 128, 0.3);
}

body {
    font-family: 'Orbitron', 'Courier New', monospace;
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 128, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 98px,
            rgba(0, 255, 255, 0.03) 100px
        );
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}


header {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(21, 21, 32, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 2px solid;
    border-image: linear-gradient(45deg, var(--primary-cyan), var(--primary-magenta)) 1;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-magenta), var(--primary-cyan));
    border-radius: 20px;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow:
        0 0 10px var(--primary-cyan),
        0 0 20px var(--primary-cyan),
        0 0 30px var(--primary-cyan);
    animation: textPulse 2s ease-in-out infinite alternate;
}

@keyframes textPulse {
    0% { text-shadow: 0 0 10px var(--primary-cyan), 0 0 20px var(--primary-cyan), 0 0 30px var(--primary-cyan); }
    100% { text-shadow: 0 0 20px var(--primary-cyan), 0 0 30px var(--primary-cyan), 0 0 40px var(--primary-cyan); }
}

.wallet-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.wallet-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

#walletAddress {
    font-weight: 700;
    color: var(--primary-green);
    text-shadow: 0 0 10px var(--primary-green);
}

.btn {
    padding: 15px 30px;
    border: 2px solid;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Orbitron', monospace;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.btn-primary:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.5),
        0 10px 30px rgba(0, 255, 255, 0.2);
}

.btn-secondary {
    border-color: var(--primary-green);
    color: var(--primary-green);
    box-shadow:
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.btn-secondary:hover {
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-3px);
    box-shadow:
        0 0 30px rgba(0, 255, 65, 0.5),
        0 10px 30px rgba(0, 255, 65, 0.2);
}

.btn-danger {
    border-color: var(--primary-magenta);
    color: var(--primary-magenta);
    box-shadow:
        0 0 20px rgba(255, 0, 128, 0.3),
        inset 0 0 20px rgba(255, 0, 128, 0.1);
}

.btn-danger:hover {
    background: rgba(255, 0, 128, 0.1);
    transform: translateY(-3px);
    box-shadow:
        0 0 30px rgba(255, 0, 128, 0.5),
        0 10px 30px rgba(255, 0, 128, 0.2);
}

.status-section {
    margin-bottom: 40px;
}

.status-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(21, 21, 32, 0.8) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glow);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-glow);
    position: relative;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta), var(--primary-yellow));
    border-radius: 15px 15px 0 0;
}

.status-card h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 40px;
    background: var(--bg-darker);
    padding: 8px;
    border-radius: 15px;
    border: 1px solid var(--border-glow);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.tab-button {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-family: 'Orbitron', monospace;
    position: relative;
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-magenta));
    color: var(--bg-dark);
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-button:hover:not(.active) {
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(21, 21, 32, 0.9) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow:
        var(--shadow-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta), var(--primary-yellow), var(--primary-green));
    border-radius: 20px 20px 0 0;
    animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.card h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-glow);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-darker);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: rgba(0, 255, 255, 0.05);
}

.status-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border: 2px solid;
}

.status-message.success {
    background: rgba(0, 255, 65, 0.1);
    color: var(--primary-green);
    border-color: var(--primary-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.status-message.error {
    background: rgba(255, 0, 128, 0.1);
    color: var(--primary-magenta);
    border-color: var(--primary-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.3);
}

.status-message.loading {
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.credits-list,
.orders-list {
    display: grid;
    gap: 20px;
}

.credit-item,
.order-item {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-glow);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
}

.credit-item:hover,
.order-item:hover {
    transform: translateY(-5px);
    box-shadow:
        var(--shadow-glow),
        0 10px 30px rgba(0, 255, 255, 0.2);
    border-color: var(--primary-cyan);
}

.credit-item h4,
.order-item h4 {
    color: var(--primary-cyan);
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--primary-cyan);
}

.credit-item p,
.order-item p {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.credit-item p strong,
.order-item p strong {
    color: var(--text-primary);
}

.credit-item .credit-actions,
.order-item .order-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.balance-info,
.stats-info {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-glow);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-glow);
}

.balance-item,
.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.balance-item:last-child,
.stats-item:last-child {
    border-bottom: none;
}

.balance-label,
.stats-label {
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-value,
.stats-value {
    font-weight: 700;
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-cyan);
    font-family: 'Courier New', monospace;
}

.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    margin-left: 15px;
    border: 3px solid var(--primary-cyan);
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--primary-cyan);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glitch effect for special elements */
.glitch {
    animation: glitch 2s infinite;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* Scroll effects */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-magenta));
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--primary-magenta), var(--primary-cyan));
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 25px;
    }

    h1 {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-button {
        min-width: calc(50% - 2.5px);
        padding: 12px 20px;
        font-size: 0.8rem;
    }

    .card {
        padding: 25px;
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.8rem;
    }

    .credit-item .credit-actions,
    .order-item .order-actions {
        flex-direction: column;
    }
}

/* Add some pulsing animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Neon border animation */
@keyframes neonBorder {
    0%, 100% {
        box-shadow:
            0 0 5px var(--primary-cyan),
            0 0 10px var(--primary-cyan),
            0 0 15px var(--primary-cyan);
    }
    50% {
        box-shadow:
            0 0 10px var(--primary-cyan),
            0 0 20px var(--primary-cyan),
            0 0 25px var(--primary-cyan);
    }
}

.neon-border {
    animation: neonBorder 2s ease-in-out infinite;
}