:root {
    color-scheme: dark;
}

body {
    background-color: #0f172a;
    color: #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

h2 {
    color: #f8fafc;
    margin-bottom: 24px;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Elements */
input, select, textarea {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
}

/* Role Cards Layout */
.role-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.role-card {
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.role-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #334155;
}

.role-card h2 {
    font-size: 1.5rem;
    margin: 1rem;
}

.role-card p {
    margin: 0 1rem 1rem;
    color: #e2e8f0;
    flex-grow: 1;
}

/* Button Styles */
.claim-button {
    position: relative;
    min-width: 120px;
    min-height: 42px;
    margin: 0 1rem 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.claim-button:hover:not(:disabled) {
    background-color: #2563eb;
}

.claim-button.loading {
    background-color: #4b5563;
    cursor: not-allowed;
}

.claim-button.claimed {
    background-color: #059669;
    cursor: not-allowed;
}

.claim-button.error {
    background-color: #dc2626;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.5em;
    border: 0.2em solid white;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    position: relative;
    top: -1px;
}

/* Messages */
.success-message {
    margin: 1rem;
    padding: 1rem;
    background-color: #064e3b;
    border: 1px solid #059669;
    border-radius: 6px;
    color: #ecfdf5;
}

.benefit-text {
    margin: 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.benefit-text a {
    color: #60a5fa;
    text-decoration: none;
}

.benefit-text a:hover {
    text-decoration: underline;
}

/* Phantom Button */
#loginButton {
    background-color: #6C5DD3;
    color: white;
    padding: 0 32px;
    border-radius: 100px;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 500;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    cursor: pointer;
}

#loginButton:hover {
    background-color: #5d4fb8;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #334155;
}

th {
    background-color: #1e293b;
    color: #f8fafc;
    font-weight: 600;
}

/* Cards and Content Sections */
.content-section {
    background-color: #1e293b;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* JSON Viewer Styles */
.json-viewer {
    font-family: monospace;
    line-height: 1.5;
    background-color: #0f172a;
    padding: 1rem;
    border-radius: 4px;
}

.text-purple-600 { color: #a78bfa; }
.text-blue-600 { color: #60a5fa; }
.text-green-600 { color: #34d399; }
.text-gray-500 { color: #94a3b8; }

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #064e3b;
    color: #a7f3d0;
    border: 1px solid #059669;
}

.alert-error {
    background-color: #7f1d1d;
    color: #fecaca;
    border: 1px solid #dc2626;
}

.alert-warning {
    background-color: #854d0e;
    color: #fef9c3;
    border: 1px solid #ca8a04;
}

/* Chart Container */
.chart-container {
    background-color: #1e293b;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    height: 400px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .role-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .role-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-container {
        padding: 10px;
    }
}