/* Portal do Bitcoin - Main CSS File */
/* Consolidated styles for all pages */

:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --ink: #1e2329;
    --muted: #6b7280;
    --line: rgba(0,0,0,.08);
    --accent: #ff8800;
    --accent-ink: #121212;
    --chip: #f1f5f9;
}

[data-theme="dark"] {
    --bg: #000000;
    --card: #0a0a0a;
    --ink: #ffffff;
    --muted: #a0a0a0;
    --line: rgba(255,255,255,.1);
    --accent: #ff9500;
    --accent-ink: #000000;
    --chip: #1a1a1a;
}

/* Base Styles */
* { 
    box-sizing: border-box; 
}

html {
    background: #f6f7f9;
}

html[data-theme="dark"] {
    background: #000000;
}

body {
    margin: 0;
    font-family: Inter, system-ui, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

a { 
    color: inherit; 
    text-decoration: none; 
}

.wrap { 
    max-width: 1200px; 
    margin: 0 auto;
    width: 100%;
    padding: 0 16px;
}

/* Page Content */
.page-content {
    padding: 20px 0;
}

/* Ensure consistent alignment for all category pages */
.page-content .wrap {
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    padding: 0 16px;
}

/* All layout pages need consistent spacing to match home page */
.page-content .three-column-layout,
.page-content .utilities-layout {
    margin-top: 0;
}

/* Grid System */
.grid {
    display: grid;
    gap: 20px;
}

.grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,.04);
}

.card h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 136, 0, .15);
    border: 1px solid var(--line);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    font-size: 14px;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--chip);
}

.btn.accent {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
}

.btn.accent:hover {
    background: #e67e00;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    font-size: 14px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #ff8800, #ffad45);
    color: #0b0b0b;
    margin-bottom: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: 32px;
    font-weight: 700;
    color: #0b0b0b;
    width: 100%;
}

.hero p {
    margin: 0 0 24px;
    font-size: 18px;
    opacity: 0.9;
    color: #0b0b0b;
    width: 100%;
}

.hero .btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Network Status */
.network-status {
    margin-bottom: 40px;
}

.network-status h2 {
    margin: 0 0 20px;
    font-size: 24px;
}

.network-stat {
    text-align: center;
}

.network-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.network-stat .label {
    color: var(--muted);
    font-size: 14px;
}

/* Bitcoin Price Chart Section */
.bitcoin-chart-section {
    margin-bottom: 40px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.timeframe-selector {
    display: flex;
    gap: 4px;
    background: var(--chip);
    border-radius: 8px;
    padding: 4px;
}

.timeframe-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeframe-btn:hover {
    background: var(--card);
    color: var(--ink);
}

.timeframe-btn.active {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 2px 4px rgba(255, 136, 0, 0.3);
}

.chart-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.price-change {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.price-change.positive {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.price-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.chart-container {
    position: relative;
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bitcoinPriceChart {
    width: 100%;
    height: 400px;
    border-radius: 8px;
}

.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--muted);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--chip);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.stat-value.positive {
    color: #22c55e;
}

.stat-value.negative {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .timeframe-selector {
        flex: 1;
    }
    
    .chart-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .current-price {
        font-size: 20px;
    }
    
    .chart-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .bitcoin-chart-section {
        padding: 16px;
    }
    
    .chart-container {
        padding: 16px;
        min-height: 300px;
    }
    
    #bitcoinPriceChart {
        height: 300px;
    }
    
    .chart-stats {
        grid-template-columns: 1fr;
    }
}

/* Categories */
.categories h2 {
    margin: 0 0 20px;
    font-size: 24px;
}

.category-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.category-card h3 {
    margin: 0;
    font-size: 18px;
}

.category-card p {
    margin: 0 0 12px;
    color: var(--muted);
}

/* Footer */
.footer {
    background: #0f1115;
    color: #a9b1ba;
    margin-top: 40px;
}

.footer .wrap {
    padding: 24px 16px;
}

.footer .grid {
    margin-bottom: 20px;
}

.footer h3 {
    font-size: 16px;
    margin: 0 0 8px;
    color: var(--accent);
}

.footer a {
    color: #a9b1ba;
}

.footer .copyright {
    border-top: 1px solid #2a2a2a;
    padding-top: 16px;
    color: #8f8f99;
    font-size: 14px;
}

/* Dashboard Sidebar Menu Styles */
.three-column-layout .page-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.three-column-layout {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 24px;
    max-width: 100%;
    width: 100%;
}

.left-sidebar {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: fit-content;
}

.sidebar-menu .menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu .menu-list li {
    margin-bottom: 8px;
}

.sidebar-menu .menu-list a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--muted);
    transition: all 0.2s ease;
    text-decoration: none;
}

.sidebar-menu .menu-list a:hover {
    background: var(--chip);
    color: var(--ink);
}

.sidebar-menu .menu-list a.active {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 136, 0, 0.3);
    transform: translateX(4px);
}

.sidebar-menu .menu-list a.active i {
    color: var(--accent-ink);
}

.sidebar-menu .menu-list a i {
    margin-right: 12px;
    width: 16px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4 {
        grid-template-columns: 1fr;
    }
    
    .hero .btn-group {
        flex-direction: column;
        align-items: center;
    }
    
    .three-column-layout {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .left-sidebar {
        order: 2;
    }
}
