/* 
 * VeriNews Design System & Premium Stylesheet
 */

:root {
    --bg-darker: #070a13;
    --bg-dark: #0d1222;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(79, 172, 254, 0.4);
    
    --text-light: #f3f4f6;
    --text-normal: #d1d5db;
    --text-muted: #9ca3af;
    
    --accent-primary: #4facfe;
    --accent-secondary: #00f2fe;
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-darker);
    color: var(--text-normal);
    font-family: var(--font-body);
    overflow-x: hidden;
    height: 100vh;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* App Layout Grid */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    background: #090e1c;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 35px;
}

.logo-icon {
    font-size: 26px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.5px;
}

.logo-text span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.02);
}

.nav-item.active {
    color: #ffffff;
    background: var(--accent-gradient);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
    font-weight: 600;
}

.nav-icon {
    font-size: 16px;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--accent-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Main Content Area */
.main-content {
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar {
    border-bottom: 1px solid var(--border-color);
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-light);
}

.page-title p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.wallet-badge-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
}

.wallet-address {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
}

/* Badge System */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-neutral {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-normal);
}
.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Tab Panels */
.tab-content-panel {
    display: none;
    padding: 30px;
    flex-grow: 1;
}

.tab-content-panel.active {
    display: block;
    animation: fadeIn 0.35s ease forwards;
}

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

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-light);
    margin-top: 15px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Block Explorer visualizer cards */
.block-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.block-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid var(--accent-primary);
    transition: all 0.2s ease;
}

.block-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

/* Forms System */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.verify-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .verify-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 12px;
    width: 100%;
    transition: all 0.2s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15);
}

/* Buttons */
.btn {
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    padding: 10px 18px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.2);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(79, 172, 254, 0.35);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--border-color);
    box-shadow: none;
}

.btn-neutral {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-normal);
}

.btn-neutral:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
}

/* Radial Gauge Chart Visual */
.radial-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.radial-container svg {
    transform: rotate(-90deg);
}

.radial-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.radial-bar {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    transition: stroke-dashoffset 0.6s ease;
}

.radial-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    color: var(--text-light);
}

.metric-row {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

/* Chat Layout: AI Advisor */
.chat-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    height: calc(100vh - 180px);
}

.chat-sidebar {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.chat-sidebar h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.chat-window {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    width: 100%;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message-ai {
    justify-content: flex-start;
}

.message-ai .message-bubble {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    color: var(--text-normal);
    border-top-left-radius: 2px;
}

.message-user {
    justify-content: flex-end;
}

.message-user .message-bubble {
    background: var(--accent-gradient);
    color: #ffffff;
    border-top-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.15);
}

.chat-input-bar {
    border-top: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    gap: 10px;
}

.chat-input-bar input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 12px;
    flex-grow: 1;
}

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

.code-inline {
    background: rgba(255,255,255,0.08);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 4px;
}

/* Typing indicator dots */
.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Solidity Code Viewer CSS */
.code-viewer-pane {
    background: #05080e;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    padding: 20px;
    white-space: pre;
    color: #a9b2c3;
    max-height: 400px;
}

.code-comment { color: #5c6370; font-style: italic; }
.code-keyword { color: #c678dd; font-weight: bold; }
.code-string { color: #98c379; }

/* Mining Modal Overlay CSS */
.mining-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 10, 19, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.mining-modal {
    background: #0d1222;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Dynamic Rotating Cube Loader */
.mining-loader {
    width: 50px;
    height: 50px;
    position: relative;
    transform: rotate(45deg);
}

.loader-cube {
    float: left;
    width: 50%;
    height: 50%;
    position: relative;
    transform: scale(1.1);
}

.loader-cube:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-primary);
    animation: foldCubeAngle 2.4s infinite linear both;
    transform-origin: 100% 100%;
}

.loader-cube:nth-child(2) { transform: scale(1.1) rotate(90deg); }
.loader-cube:nth-child(3) { transform: scale(1.1) rotate(270deg); }
.loader-cube:nth-child(4) { transform: scale(1.1) rotate(180deg); }

.loader-cube:nth-child(2):before { animation-delay: 0.3s; }
.loader-cube:nth-child(3):before { animation-delay: 0.9s; }
.loader-cube:nth-child(4):before { animation-delay: 0.6s; }

@keyframes foldCubeAngle {
    0%, 10% {
        transform: perspective(140px) rotateX(-180deg);
        opacity: 0; 
    } 
    25%, 75% {
        transform: perspective(140px) rotateX(0deg);
        opacity: 1; 
    } 
    90%, 100% {
        transform: perspective(140px) rotateY(180deg);
        opacity: 0; 
    }
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.1s linear;
}

/* Toast Notifications styling */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
}

.toast {
    background: #0d1222;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease forwards;
}

.toast-success { border-left: 4px solid var(--accent-success); }
.toast-error { border-left: 4px solid var(--accent-danger); }
.toast-warning { border-left: 4px solid var(--accent-warning); }
.toast-info { border-left: 4px solid var(--accent-primary); }

.toast-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding-left: 8px;
}

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

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}
