:root {
    --primary-color: #165eb2;
    --primary-dark: #0f4078;
    --bg-dark: #1a1a1a;
    --bg-darker: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #2a2a2a;
    --card-bg: #222222;
    --hover-bg: #2d2d2d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 30px;
}

.logo a {
    text-decoration: none;
    color: var(--text-primary);
}

.logo h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 2px;
    background: linear-gradient(135deg, #165eb2, #4a9eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .tagline {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    text-decoration: none;
    color: white;
    background-color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
    text-transform: lowercase;
    border: 2px solid transparent;
}

.nav-link:hover {
    background-color: #0f4a8a;
}

.nav-link.active {
    border: 2px solid #60a5fa;
    box-shadow: 0 0 0 1px #60a5fa;
}

.nav-link.nav-112 {
    background: #dc2626;
    color: white;
}

.nav-link.nav-112:hover {
    background: #b91c1c;
}

.nav-link.nav-112.active {
    background: #dc2626;
    border: 2px solid #fca5a5;
    box-shadow: 0 0 0 1px #fca5a5;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background-color: var(--card-bg);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 44px;
    height: 44px;
}

.account-btn:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.account-btn svg {
    width: 20px;
    height: 20px;
}

.login-btn {
    color: var(--primary-color);
}

.weather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background-color: var(--card-bg);
    border-radius: 8px;
    min-height: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.weather:hover {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
}

.temp {
    font-weight: 600;
    font-size: 16px;
}

.weather-icon {
    font-size: 20px;
}

.gas-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background-color: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    min-height: 44px;
    height: 44px;
}

.gas-price:hover {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gas-icon {
    font-size: 20px;
}

.gas-price-text {
    font-weight: 600;
    font-size: 15px;
    color: #10b981;
}

.gas-address {
    font-size: 9px;
    color: var(--text-secondary);
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Main Content */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.main-content-area {
    min-width: 0;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 25px;
}

/* Hero Article */
.hero-article {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.hero-article a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.hero-image {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hero-article:hover .hero-image img {
    transform: scale(1.05);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.hero-content h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 800px;
    margin-bottom: 0;
}

.card-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.category-badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.date-badge {
    display: inline-block;
    background-color: var(--bg-darker);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.video-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Most Read Section */
.most-read {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 40px;
}

.most-read h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.most-read-list {
    display: grid;
    gap: 15px;
}

.most-read-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    position: relative;
}

.most-read-item:hover {
    background-color: var(--hover-bg);
}

.most-read-image {
    width: 120px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.most-read-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.most-read-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.most-read-content h4 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.most-read-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.most-read-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: auto;
}

.most-read-views {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.news-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.news-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

/* Video styles for cards */
.news-card-image video,
.most-read-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

/* Mobile video/image visibility control */
.mobile-hide {
    display: block;
}

.mobile-only {
    display: none;
}

/* Mobile video wrapper and play icon */
.mobile-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: none;
}

.mobile-video-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    padding-left: 2px;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Hide videos on mobile/tablet devices, show fallback images */
@media (max-width: 1024px), (orientation: portrait) {
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .mobile-video-wrapper {
        display: block !important;
    }
    
    /* Disable video hover effects on mobile */
    .hover-play-video {
        display: none !important;
    }
}

.news-card:hover .news-card-image img {
    transform: scale(1.1);
}

.news-card:hover .news-card-image video,
.most-read-item:hover .most-read-image video {
    transform: scale(1.1);
}

.news-card-content {
    padding: 20px;
    position: relative;
}

.news-card-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.news-card-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 30px;
}

.article-views {
    position: absolute;
    bottom: 12px;
    right: 15px;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* No Articles */
.no-articles {
    text-align: center;
    padding: 60px 20px;
}

.no-articles p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-page {
    padding: 10px 16px;
    background-color: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 44px;
    text-align: center;
}

.pagination-btn:hover,
.pagination-page:hover {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
}

.pagination-page.active {
    background-color: var(--primary-color);
    color: white;
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Right Sidebar - Only show on landscape devices */
.right-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Hide sidebar on portrait devices (phones and portrait tablets) */
@media (max-width: 1024px) and (orientation: portrait), (max-width: 768px) {
    .right-sidebar {
        display: none;
    }
    
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
}

.sidebar-section {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.sidebar-article-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-article-item {
    border-bottom: 1px solid var(--border-color);
}

.sidebar-article-item:last-child {
    border-bottom: none;
}

.sidebar-article-item a {
    display: block;
    padding: 12px 0;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-article-item a:hover {
    color: var(--primary-color);
}

.sidebar-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 14px;
}

/* History Year Buttons */
.history-year-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.year-btn {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.year-btn:hover {
    background-color: var(--hover-bg);
    border-color: var(--primary-color);
}

.year-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Fuel Prices in Sidebar */
.fuel-prices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-decoration: none;
}

.fuel-price-item {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.fuel-prices-grid:hover .fuel-price-item {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
}

.fuel-type {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.fuel-value {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--primary-dark);
}

/* Footer */
.footer {
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-note {
    font-size: 12px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 0;
    }
    
    .logo {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .logo .tagline {
        font-size: 11px;
    }
    
    .header-right {
        flex: 0 0 auto;
        margin-left: auto;
        order: 2;
        gap: 10px;
    }
    
    .account-btn span {
        display: none;
    }
    
    .account-btn {
        padding: 6px 10px;
    }
    
    .account-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .weather {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .temp {
        font-size: 14px;
    }
    
    .temp-f {
        font-size: 10px !important;
    }
    
    .weather-icon {
        font-size: 20px !important;
    }
    
    .gas-price {
        padding: 6px 10px;
        gap: 5px;
    }
    
    .gas-icon {
        font-size: 18px;
    }
    
    .gas-price-text {
        font-size: 13px;
    }
    
    .main-nav {
        width: 100%;
        flex-basis: 100%;
        order: 3;
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 2px 0;
    }
    
    .main-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-link {
        white-space: nowrap;
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .hero-image {
        height: 250px;
    }
    
    .hero-content {
        padding: 20px 15px;
    }
    
    .hero-content h2 {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .hero-content p {
        font-size: 14px;
        margin-top: 8px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .news-card-image {
        height: 180px;
    }
    
    .news-card-content {
        padding: 15px;
    }
    
    .news-card-content h3 {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .news-card .news-card-content p {
        display: none !important;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .most-read {
        padding: 18px;
    }
    
    .most-read h3 {
        font-size: 18px;
    }
    
    .most-read-image {
        width: 90px;
        height: 65px;
    }
    
    .most-read-content h4 {
        font-size: 14px;
    }
    
    .pagination {
        gap: 6px;
        margin-top: 30px;
        margin-bottom: 30px;
    }
    
    .pagination-btn,
    .pagination-page {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 38px;
    }
}

@media (max-width: 480px) {
    .hero-image {
        height: 200px;
    }
    
    .hero-content {
        padding: 15px 12px;
    }
    
    .hero-content h2 {
        font-size: 18px;
    }
    
    .hero-content p {
        font-size: 13px;        display: none !important;        display: none !important;
    }
    
    .news-card-image {
        height: 160px;
    }
    
    .news-card .news-card-content p {
        display: none !important;
    }
    
    .most-read-image {
        width: 80px;
        height: 55px;
    }
    
    .most-read-content h4 {
        font-size: 13px;
    }
    
    .category-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
}
