:root {
    --primary: #5a67d8;
    --primary-dark: #4c51bf;
    --secondary: #38b2ac;
    --dark: #2d3748;
    --light: #f7fafc;
    --gray: #e2e8f0;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --border-radius: 10px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}
.hidden {
    display: none !important;
}

/* Login Page Styles */
.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    color: var(--primary);
}

.login-logo i {
    font-size: 2.5rem;
    margin-right: 15px;
}

.login-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #718096;
    margin-bottom: 30px;
    font-size: 1rem;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.form-input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.login-btn:hover {
    background: var(--primary-dark);
}

.login-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 15px;
    min-height: 20px;
}

.demo-credentials {
    margin-top: 30px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: left;
}

.demo-credentials h3 {
    margin-bottom: 10px;
    color: var(--dark);
    font-size: 1rem;
}

.demo-credentials p {
    margin-bottom: 5px;
    color: #718096;
}

.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.logout-btn:hover {
    background: #e53e3e;
}
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--primary);
}

.logo i {
    font-size: 2.5rem;
    margin-right: 15px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 1.1rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto 30px;
}

.data-source {
    background: white;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    display: inline-block;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.data-source i {
    color: var(--secondary);
    margin-right: 8px;
}

.contract-info {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

.contract-info h3 {
    color: var(--dark);
    margin-bottom: 10px;
}

.contract-address {
    font-family: monospace;
    background: #f7fafc;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 10px 0;
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.contract-address:hover {
    background: #e2e8f0;
}

.data-update {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.update-info {
    display: flex;
    align-items: center;
}

.update-info i {
    font-size: 1.5rem;
    color: var(--success);
    margin-right: 15px;
}

.last-update {
    font-size: 0.9rem;
    color: #718096;
}

.last-update strong {
    color: var(--dark);
}

.refresh-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    display: none;
}

.refresh-btn:hover {
    background: var(--primary-dark);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.refresh-btn i {
    margin-right: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
}

.stat-card:nth-child(1)::before { background-color: var(--primary); }
.stat-card:nth-child(2)::before { background-color: var(--secondary); }
.stat-card:nth-child(3)::before { background-color: var(--success); }
.stat-card:nth-child(4)::before { background-color: var(--warning); }
.stat-card:nth-child(5)::before { background-color: var(--danger); }
.stat-card:nth-child(6)::before { background-color: #9f7aea; }
.stat-card:nth-child(7)::before { background-color: #4299e1; }
.stat-card:nth-child(8)::before { background-color: #ed64a6; }

.stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon { background-color: var(--primary); }
.stat-card:nth-child(2) .stat-icon { background-color: var(--secondary); }
.stat-card:nth-child(3) .stat-icon { background-color: var(--success); }
.stat-card:nth-child(4) .stat-icon { background-color: var(--warning); }
.stat-card:nth-child(5) .stat-icon { background-color: var(--danger); }
.stat-card:nth-child(6) .stat-icon { background-color: #9f7aea; }
.stat-card:nth-child(7) .stat-icon { background-color: #4299e1; }
.stat-card:nth-child(8) .stat-icon { background-color: #ed64a6; }

.stat-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-subtitle {
    font-size: 0.85rem;
    color: #718096;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark);
    min-height: 45px;
    /* display: flex; */
    align-items: center;
}

.stat-details {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
    min-height: 40px;
}
.sub-value {
    display: block;
    width: 132%;
}
.progress-bar {
    height: 8px;
    background-color: var(--gray);
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0%;
    transition: width 0.6s ease-in-out;
}

.data-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
}

.status-live {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cached {
    background-color: #e0e7ff;
    color: #3730a3;
}

.status-simulated {
    background-color: #fef3c7;
    color: #92400e;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

.loading-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.blockchain-info {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.blockchain-info h3 {
    color: var(--dark);
    margin-bottom: 20px;
    text-align: center;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 15px;
}

.info-label {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 4px;
}

.info-value {
    font-weight: 600;
    color: var(--dark);
}

footer {
    text-align: center;
    padding: 25px;
    color: #718096;
    font-size: 0.9rem;
    border-top: 1px solid var(--gray);
    margin-top: 40px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease-out;
}

.notification-success {
    background-color: var(--success);
}

.notification-error {
    background-color: var(--danger);
}

.notification-info {
    background-color: var(--primary);
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .data-update {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .contract-address {
        font-size: 0.85rem;
        word-break: break-all;
    }
}