/* Reset e Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 50%, #0f0f0f 100%);
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    position: relative;
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(rgba(30, 60, 114, 0.7), rgba(42, 82, 152, 0.7)), url('london-stock-exchange-header-v2.png') center/cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header-logo {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    padding: 5px;
}

.logo-svg {
    width: 70px;
    height: 70px;
    transition: transform 0.3s ease;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo-svg:hover {
    transform: scale(1.1);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s ease-in-out infinite alternate;
}

.status-dot.loading {
    background: #FF9800;
}

.status-dot.error {
    background: #F44336;
}

@keyframes pulse {
    from { opacity: 1; }
    to { opacity: 0.5; }
}

/* Main Content */
.main-content {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

/* Price Section - Dual Currency */
.price-section {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.price-card.dual-currency {
    background: linear-gradient(145deg, #000000, #1a1a1a);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.6), 
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1),
        0 0 20px rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
}

.price-card.dual-currency::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border-radius: 20px;
    pointer-events: none;
}

.dual-price-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
    margin-top: 20px;
}

.currency-block {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.usd-block {
    border-left: 4px solid #00ff88;
}

.eur-block {
    border-left: 4px solid #FFD700;
}

.currency-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 10px;
    font-weight: bold;
}

.currency-block .price-value {
    font-size: 2.2em;
    font-weight: bold;
    margin: 10px 0;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.eur-block .price-value {
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.currency-block .price-unit {
    font-size: 0.8em;
    opacity: 0.7;
    margin-bottom: 10px;
}

.currency-separator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-left: 2px dashed rgba(255, 255, 255, 0.1);
    border-right: 2px dashed rgba(255, 255, 255, 0.1);
}

.exchange-info {
    text-align: center;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.exchange-rate {
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    margin-bottom: 5px;
}

.exchange-source {
    font-size: 0.7em;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.8);
}

.price-change {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 10px;
}

.price-change.positive {
    color: #4CAF50;
}

.price-change.negative {
    color: #F44336;
}

/* Market Stats - Dual Currency - Compatta */
.market-stats.dual-stats {
    background: linear-gradient(145deg, #1a1a1a, #2e2e2e);
    border-radius: 15px;
    padding: 15px;
}

.stats-header {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.stats-header h3 {
    color: #FFD700;
    font-size: 1.0em;
    margin: 0;
}

.dual-stat .stat-values {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value.usd {
    color: #00ff88;
    font-size: 0.9em;
}

.stat-value.eur {
    color: #FFD700;
    font-size: 0.8em;
    opacity: 0.9;
}

.exchange-rate-stat .exchange-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exchange-update {
    font-size: 0.65em;
    opacity: 0.6;
}

/* Chart Controls - Currency Toggle */
.chart-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.currency-toggle {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 10px;
}

.currency-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8em;
}

.currency-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.currency-btn.active {
    background: #4CAF50;
    color: #000;
    border-color: #4CAF50;
}

.period-controls {
    display: flex;
    gap: 10px;
}

/* Table Updates */
.data-table th {
    font-size: 0.9em;
}

.price-cell.eur {
    color: #FFD700;
}

.exchange-cell {
    color: #4CAF50;
    font-weight: bold;
    font-size: 0.9em;
}

/* Chart Section */
.chart-section {
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

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

.chart-header h3 {
    color: #FFD700;
    font-size: 1.3em;
}

.chart-controls {
    display: flex;
    gap: 10px;
}

.chart-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chart-btn.active {
    background: #FFD700;
    color: #000;
    border-color: #FFD700;
}

.chart-wrapper {
    position: relative;
    height: 400px;
}

/* Data Section */
.data-section {
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.table-header h3 {
    color: #FFD700;
    font-size: 1.3em;
}

.refresh-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.auto-refresh-info {
    font-size: 0.9em;
    opacity: 0.7;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th {
    background: linear-gradient(45deg, #333, #444);
    color: #FFD700;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #FFD700;
    font-weight: bold;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tr:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

.price-cell {
    color: #00ff88;
    font-weight: bold;
}

.change-cell.positive {
    color: #4CAF50;
    font-weight: bold;
}

.change-cell.negative {
    color: #F44336;
    font-weight: bold;
}

.neutral-cell {
    opacity: 0.7;
}

.time-cell {
    font-size: 0.9em;
    opacity: 0.8;
}

.volume-cell {
    color: #2196F3;
    font-weight: bold;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-top: 3px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Footer */
.footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

.disclaimer {
    font-size: 0.8em;
    margin-top: 10px;
    color: #FF9800;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .price-section {
        grid-template-columns: 1fr;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .refresh-controls {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .price-value {
        font-size: 2.5em;
    }
    
    .market-stats {
        padding: 10px;
    }
    
    .stat-item {
        padding: 6px;
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.9em;
    }
}