/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2d5016 0%, #4a7c59 50%, #6b9b7d 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d5016;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #4a7c59;
    margin-bottom: 25px;
}

.wallet-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f7f0;
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid #b8d4b8;
}

#walletAddress {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #4a5568;
}

#networkStatus {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: #52a868;
    color: white;
    font-weight: 500;
}

/* Panel Styles */
.panel {
    margin-bottom: 40px;
}

.panel h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card h3 {
    font-size: 1.4rem;
    color: #2d5016;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #b8d4b8;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    color: #2d5016;
    margin-bottom: 8px;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #b8d4b8;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: #52a868;
    box-shadow: 0 0 0 3px rgba(82, 168, 104, 0.1);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #52a868 0%, #3d8f54 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(82, 168, 104, 0.4);
}

.btn-secondary {
    background: #d4e4d4;
    color: #2d5016;
}

.btn-secondary:hover {
    background: #b8d4b8;
}

.btn-success {
    background: #52a868;
    color: white;
}

.btn-danger {
    background: #c74848;
    color: white;
}

/* Token and Request Lists */
.tokens-list, .requests-list, .history-list {
    max-height: 400px;
    overflow-y: auto;
}

.token-item, .request-item, .history-item {
    background: #f0f7f0;
    border: 1px solid #b8d4b8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.token-info, .request-info, .history-info {
    flex: 1;
}

.token-id {
    font-weight: 600;
    color: #2d5016;
}

.token-level, .request-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 10px;
}

.level-none { background: #d4e4d4; color: #4a5568; }
.level-basic { background: #c8e6c9; color: #2d5016; }
.level-premium { background: #a5d6a7; color: #1b5e20; }
.level-admin { background: #81c784; color: #1b5e20; }
.level-encrypted { background: #66bb6a; color: #ffffff; }

.token-status {
    font-size: 0.9rem;
    color: #4a7c59;
}

.request-actions {
    display: flex;
    gap: 8px;
}

/* Status Message */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.status-content {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-message.success {
    border-left: 4px solid #52a868;
}

.status-message.error {
    border-left: 4px solid #c74848;
}

.status-message.info {
    border-left: 4px solid #66bb6a;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
    padding: 0;
    margin-left: 15px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #52a868;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    color: white;
    font-size: 1.1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Ensure panels are visible by default */
.panel {
    display: block;
}

/* Override any hidden states on main content */
#userPanel {
    display: block !important;
}

#adminPanel.hidden {
    display: none;
}

/* Make sure the main container is always visible */
.container {
    display: block;
    opacity: 1;
}

.loading {
    text-align: center;
    color: #4a7c59;
    font-style: italic;
    padding: 20px;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .wallet-section {
        flex-direction: column;
    }

    .token-item, .request-item, .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .request-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .status-message {
        left: 15px;
        right: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 20px 15px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .request-actions .btn {
        width: auto;
        margin-bottom: 0;
    }
}