/* --- General Reset & Base Styles --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', sans-serif; 
}

body {
    background-color: #000;
    color: white;
    height: 100vh;
    overflow: hidden; 
}

.dashboard-container {
    display: grid;
    grid-template-rows: 110px 1fr 40px; 
    height: 100%;
    width: 100%;
}

/* --- Weather Bar (Top) --- */
.weather-bar {
    background-color: #1a3c6e; 
    display: flex;
    align-items: center;
    padding: 0 30px;
    width: 100%;
    border-bottom: 2px solid #444;
}

.weather-left {
    display: flex;
    align-items: center;
    gap: 40px; 
    flex-shrink: 0; 
    margin-right: 50px; 
    padding-right: 30px;
    border-right: 1px solid rgba(255,255,255,0.1); 
}

.weather-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.town-name { font-size: 1.1rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.weather-label { font-size: 0.8rem; font-weight: 400; opacity: 0.9; }

.current-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-icon { font-size: 3.5rem; color: #ffeb3b; } 
.current-temp-group { display: flex; flex-direction: column; justify-content: center; }
.current-temp { font-size: 2.8rem; font-weight: 700; line-height: 1; }
.current-desc { font-size: 0.9rem; opacity: 0.9; text-transform: lowercase; }

.forecast-container {
    display: flex;
    flex-grow: 1;
    justify-content: space-between; 
    align-items: center;
}

.forecast-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.f-day-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 5px; }
.f-icon { font-size: 1.8rem; margin: 5px 0; }
.f-temps { 
    font-size: 0.9rem; 
    font-weight: bold; 
    display: flex; 
    gap: 10px; 
}

.high-temp { color: #ff8c42; } 
.low-temp { color: #64b5f6; } 

/* --- Main Layout --- */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr; 
    height: 100%;
    overflow: hidden;
}

/* --- Video Section --- */
.video-container {
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden; 
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

#video-marquee-wrap {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

#video-marquee-text {
    display: inline-block;
    will-change: transform;
}

@keyframes scrollVideoMarquee {
    0% { transform: translateX(100%); } 
    100% { transform: translateX(-100%); }
}

/* --- Sidebar (Forex & News) --- */
.sidebar {
    background: #111;
    display: grid;             
    grid-template-rows: 1fr 1fr; 
    height: 100%;
    border-left: 1px solid #333;
    overflow: hidden;
}

.widget-box {
    display: flex;
    flex-direction: column;
    overflow: hidden;         
    border-bottom: 1px solid #333;
    padding: 10px;
    position: relative;
    min-height: 0; 
}

h3 { 
    flex-shrink: 0;           
    font-size: 0.9rem; 
    color: #ddd; 
    margin-bottom: 5px; 
    border-bottom: 1px solid #444; 
    padding-bottom: 5px; 
    background: #111;
    z-index: 10;
}

/* --- Vertical Scrolling (Global Logic) --- */
.scroll-window {
    flex-grow: 1;            
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.vertical-scroll-content {
    display: flex;
    flex-direction: column;
	gap: 0;
    animation: scrollVertical 40s linear infinite; 
    will-change: transform;
}

@keyframes scrollVertical {
    0% { transform: translateY(0); }
    100% { transform: translateY(-33.3333%); } 
}

/* --- Forex Item Styling --- */
.forex-header-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr 1fr; /* Pair | Price | Pair | Price */
    font-size: 0.85rem; /* Slightly smaller to fit 4 columns */
    color: #A5D8FF;
    padding-bottom: 5px;
    border-bottom: 2px solid #333;
    margin-bottom: 5px;
    flex-shrink: 0;
}
/* Adjust alignment for the header spans */
.forex-header-row span {
    padding-left: 5px;
} 

.forex-header-row span:last-child {
    text-align: left;
    padding-right: 15px;
}

.forex-item {
	display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr 1fr; 
    padding: 8px 0;
    border-bottom: 1px solid #222;
    font-size: 0.9rem; /* Adjusted for density */
    align-items: center;
    box-sizing: border-box;
}

.pair-col { 
    color: #A5D8FF; 
    font-weight: 800; 
    padding-left: 5px;
}

.price-col { 
    color: #FBBF24; 
    font-family: 'Courier New', monospace;
    padding-left: 5px;
}

/* Container for the duplicated sets in JS */
.forex-set {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
	flex-shrink: 0;
}

/* --- News Item Styling --- */
.news-item { 
    padding: 12px 0; 
    border-bottom: 1px solid #222; 
}
.news-source { color: #3498db; font-size: 0.75rem; font-weight: bold; margin-bottom: 2px; }
.news-headline { font-size: 0.95rem; line-height: 1.3; color: #eee; }

/* --- Stock Ticker (Bottom Bar) --- */
.ticker-wrap {
    background: #000;
    border-top: 1px solid #333;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    height: 40px;
}

.ticker-move {
    display: flex;
    animation: scrollHorizontal 35s linear infinite;
}

@keyframes scrollHorizontal {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}


.ticker-item {
    display: flex;
    align-items: center;
    /* Increase this value to add more space between the stock groups */
    padding: 0 3rem; 
    height: 100%;
    flex-shrink: 0;
}

.ticker-logo {
    width: 24px;
    height: 24px;
    /* This adds space specifically between the logo and the text symbol */
    margin-right: 12px; 
    object-fit: contain;
    vertical-align: middle;
}

.ticker-symbol {
    font-weight: 800;
    color: #fff;
    /* Adds a small gap between the symbol and the price */
    margin-right: 15px; 
}

.ticker-price {
    color: #eee;
    margin: 0 10px;
    font-family: 'Courier New', monospace;
}

.green { color: #4caf50; }
.red { color: #f44336; }

.update-timestamp {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.6rem;
    color: #555;
    z-index: 20;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    pointer-events: none;
    border-radius: 2px;
}