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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: white;
}
.footer p {
    font-size: 0.9rem;
    opacity: 0.9;
}
.footer a {
    color:yellow;
}

.controls {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

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

.control-item {
    display: flex;
    flex-direction: column;
}

.control-item label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.control-item select,
.control-item input {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.control-item select:focus,
.control-item input:focus {
    outline: none;
    border-color: #667eea;
}

.file-input-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-container input[type=file] {
    position: absolute;
    left: -9999px;
}

.control-item .file-input-label {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-weight: 500;
}

.file-input-label:hover {
    transform: translateY(-2px);
}

.status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-card {
    background: white;
    padding: 25px 25px 0 25px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.chart-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 360px;
}

/* D3.js specific styles */
.grid line {
    stroke: #e0e0e0;
    stroke-opacity: 0.5;
}

.grid path {
    stroke-width: 0;
}

.axis {
    font-size: 10px;
}

.axis text {
    fill: #666;
}

.axis path,
.axis line {
    fill: none;
    stroke: #666;
    shape-rendering: crispEdges;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}

.hive-logo-icon {
    height: 1.1em;
    width: auto;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .control-group {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Section Styles */
.dashboard-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.dashboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.account-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.account-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
}

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

/* Portfolio Summary Cards */
.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.summary-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.summary-card.total-portfolio {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.summary-card.total-portfolio h3 {
    color: white;
}

.summary-card.layer1-holdings::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

.summary-card.diesel-pools::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
}

.summary-card.regular-tokens::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.summary-card.specific-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.value-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.currency-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-card.total-portfolio .currency-value {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.currency-label {
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0.8;
}

.summary-card.total-portfolio .currency-label {
    color: rgba(255, 255, 255, 0.9);
}

.value-amount {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
}

.summary-card.total-portfolio .value-amount {
    color: white;
}

/* Performance Metrics within Cards */
.performance-metrics {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.summary-card.total-portfolio .performance-metrics {
    border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.performance-metrics h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #555;
    text-align: center;
}

.summary-card.total-portfolio .performance-metrics h4 {
    color: rgba(255, 255, 255, 0.9);
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-width: 200px;
    margin: 0 auto;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background-color 0.2s ease;
    min-height: 50px;
    justify-content: center;
}

.summary-card.total-portfolio .metric-item {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.metric-item:hover {
    transform: translateY(-1px);
    background: rgba(0, 0, 0, 0.08);
}

.summary-card.total-portfolio .metric-item:hover {
    background: rgba(255, 255, 255, 0.3);
}

.metric-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 3px;
    text-align: center;
    line-height: 1.1;
}

.summary-card.total-portfolio .metric-label {
    color: rgba(255, 255, 255, 0.8);
}

.metric-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    line-height: 1.1;
}

.summary-card.total-portfolio .metric-value {
    color: white;
}

.metric-value.positive {
    color: #28a745;
}

.summary-card.total-portfolio .metric-value.positive {
    color: #90ee90;
}

.metric-value.negative {
    color: #dc3545;
}

.summary-card.total-portfolio .metric-value.negative {
    color: #ffb3b3;
}

.metric-value.neutral {
    color: #6c757d;
}

.summary-card.total-portfolio .metric-value.neutral {
    color: rgba(255, 255, 255, 0.7);
}

/* Hidden state for performance metrics */
.performance-metrics.hidden {
    display: none;
}

/* Specific Item Display */
.specific-item-display {
    margin-bottom: 40px;
}

.specific-item-display .summary-card {
    margin: 0 auto;
    max-width: 400px;
}

/* Performance Section (if needed separately) */
.performance-section {
    margin-top: 40px;
}

.performance-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

.performance-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.performance-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e1e5e9;
    position: relative;
    overflow: hidden;
}

.performance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.performance-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* Responsive Design for Dashboard */
@media (max-width: 1024px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
    
    .account-info {
        align-items: center;
    }
    
    .portfolio-summary {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .metric-row {
        grid-template-columns: repeat(2, 1fr);
        max-width: 180px;
    }
}

@media (max-width: 768px) {
    .dashboard-section {
        padding: 20px;
    }
    
    .dashboard-header h2 {
        font-size: 1.5rem;
    }
    
    .portfolio-summary {
        grid-template-columns: 1fr;
    }
    
    .summary-card {
        padding: 20px;
        min-height: 250px;
    }
    
    .metric-row {
        grid-template-columns: repeat(2, 1fr);
        max-width: 160px;
    }
    
    .metric-item {
        padding: 6px 4px;
        min-height: 45px;
    }
    
    .metric-label {
        font-size: 0.65rem;
    }
    
    .metric-value {
        font-size: 0.8rem;
    }
    
    .performance-section h3 {
        font-size: 1.3rem;
    }
    
    .performance-card h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .metric-row {
        grid-template-columns: repeat(2, 1fr);
        max-width: 140px;
    }
    
    .currency-value {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .value-amount {
        font-size: 1.1rem;
    }
    
    .summary-card {
        min-height: 220px;
    }
    
    .metric-item {
        min-height: 40px;
    }
    
    .metric-label {
        font-size: 0.6rem;
    }
    
    .metric-value {
        font-size: 0.75rem;
    }
}
