/* Modernize Edilmiş CSS (1. versiyon baz alınarak güncellendi) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: #f0f0f0;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.header {
    background-color: #ff4500;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    z-index: 10;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    animation: bounce 1s infinite; /* Zıplama animasyonu */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.logo {
    font-size: 36px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#finance-ticker {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-right: 10px;
    white-space: nowrap; /* Metnin taşmasını önler */
}

#clock,
.language {
    font-size: 16px;
    font-weight: bold;
}

.language {
    cursor: pointer;
}

.category-menu {
    display: flex;
    background-color: #e03e00;
    padding: 8px 20px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid #ff6a36;
    border-bottom: 1px solid #d13700;
    align-items: center;
    justify-content: space-between;
}

.size-controls {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.size-btn {
    background-color: #333;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 15px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    outline: none;
}

.size-btn:hover {
    background-color: #555;
}

.size-btn:active {
    transform: scale(0.98);
}

.category-source-menu {
    display: flex;
    background-color: #2d3123;
    padding: 11px 20px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid #ff6a36;
    border-bottom: 1px solid #d13700;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
    min-height: 40px; /* Menü boşken bile görünür olması için */
}

.category-source-menu:empty::after {
    content: "Kaynaklar yükleniyor...";
    color: white;
    font-size: 14px;
    padding: 5px;
}

.category-source-title {
    font-size: 13px;
    font-weight: bold;
    line-height: 0.5;
    flex-grow: 0;
    padding: 5px 2px;
    overflow: hidden;
    display: inline-block;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    color: white;
    align-content: center;
    margin: 0;
}

.source-item {
    display: flex;
    align-items: center;
    margin-right: 2px;
    color: white;
    font-size: 14px;
    text-align: left;
}

.source-item input[type="checkbox"] {
    margin-right: 5px;
    margin-left: 5px;
}

.category-btn {
    background-color: #333;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 18px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 15px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    outline: none;
}

.category-btn:last-child {
    margin-right: 0;
}

.category-btn:hover:not(.active) {
    background-color: #555;
}

.category-btn:active:not(.active) {
    transform: scale(0.98);
}

.category-btn.active {
    background-color: #fff;
    color: #ff4500;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* Renkli kategoriler için eski yapı da korunabilir (isteğe bağlı) */
.category-btn.active[data-category="Son Dakika"] { background-color: #ff0000; color: white; }
.category-btn.active[data-category="Spor"] { background-color: #008000; color: white; }
.category-btn.active[data-category="Magazin"] { background-color: #800080; color: white; }
.category-btn.active[data-category="Dünya"] { background-color: #ffa500; color: white; }
.category-btn.active[data-category="Gündem"] { background-color: #0000ff; color: white; }
.category-btn.active[data-category="Politika"] { background-color: #666; color: white; }
.category-btn.active[data-category="Otomobil"] { background-color: #00008B; color: white; }
.category-btn.active[data-category="Teknoloji"] { background-color: #00BFFF; color: white; }
.category-btn.active[data-category="Ekonomi"] { background-color: #466e98; color: white; }

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: #fff;
    border-top: 3px solid #ccc;
}

#news-list {
    flex: 0 0 60%;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f8f8;
    border-right: 1px solid #ccc;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    align-content: start;
}

.news-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    /* overflow: hidden; kaldırıldı */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 220px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative; /* .news-new için pozisyon referansı */
}

.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.12);
}

.news-image {
    width: 100%;
    height: 110px;
    object-fit: cover;
    background-color: #eee;
    border-bottom: 1px solid #eee;
    overflow: hidden; /* Taşmayı burada kontrol et */
}

.news-title {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.3;
    flex-grow: 1;
    padding: 8px 8px 8px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    color: white;
}

.news-date {
    font-size: 11px;
    color: #fff;
    text-align: center;
    padding: 3px 5px;
    border-radius: 4px;
    margin: 8px;
    background-color: rgba(0, 0, 0, 0.3);
}

.news-detail {
    flex: 0 0 40%;
    background-color: #e9e9e9;
    overflow: hidden;
    position: relative;
}

.news-detail iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.news-new {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: #ff0000;
    color: white;
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 10; /* Daha yüksek bir z-index */
    display: block !important;
    opacity: 1 !important;
}

.news-item:hover .news-new {
    display: block !important;
    opacity: 1 !important;
}

/* Mobil Menü Stilleri */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.close-menu-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.mobile-categories {
    padding: 50px 20px;
}

.category-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.mobile-category-item {
    display: flex;
    flex-direction: column;
}

.mobile-category-title {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    display: block;
}

.mobile-source-item {
    display: flex;
    align-items: center;
    color: white;
    font-size: 14px;
    margin: 5px 0;
}

.mobile-source-item input[type="checkbox"] {
    margin-right: 10px;
}

/* Mobil Menüdeki Ayar Butonları (Sadece Sıfırlama Butonu Kaldı) */
.mobile-settings {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
}

.settings-btn {
    padding: 8px 16px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    background-color: #1f1717;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.settings-btn:hover {
    background-color: #da190b;
}

/* Haber Detay Overlay */
.news-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 200;
    display: none;
    flex-direction: column;
}

.news-detail-overlay.active {
    display: flex;
}

.header-frame {
    background-color: #f0f0f0;
    padding: 10px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 50px;
    flex-shrink: 0;
}

.close-overlay-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsive */
@media (max-width: 992px) {
    #news-list {
        flex: 0 0 50%;
    }
    .news-detail {
        flex: 0 0 50%;
    }
    .news-item {
        height: 200px;
    }
    .news-image {
        height: 100px;
    }
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    .category-menu, .category-source-menu, .size-controls {
        display: none;
    }

    .main-content {
        flex-direction: column;
        height: auto;
    }

    #news-list {
        flex: 1 1 auto;
        width: 100%;
        height: 100vh;
        border-right: none;
        border-bottom: none;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .news-item {
        height: 170px;
    }

    .news-image {
        height: 60px;
    }

    .news-title {
        font-size: 12px;
        -webkit-line-clamp: 4;
    }

    .news-date {
        font-size: 10px;
        margin: 5px;
    }

    .news-detail {
        display: none;
    }

    .header-top {
        padding: 8px 15px;
    }
    .logo {
        font-size: 28px;
    }
    #clock, .language {
        font-size: 14px;
    }

    #finance-ticker {
        display: none; /* Mobilde finans ticker'ı gizle */
    }

    .header-right {
        gap: 10px; /* + ve - tuşları arasındaki mesafeyi azalt */
    }

    .header-right .size-btn {
        display: inline-block;
        padding: 5px 10px;
        font-size: 14px;
    }
}

@media (min-width: 769px) {
    .header-right .size-btn {
        display: none;
    }

    .category-source-menu {
        display: flex !important; /* PC'de her zaman görünür olmasını sağla */
    }
}

@media (max-width: 480px) {
    #news-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .news-item {
        height: 150px;
    }

    .news-image {
        height: 50px;
    }

    .news-title {
        font-size: 11px;
        -webkit-line-clamp: 4;
    }

    .news-date {
        font-size: 9px;
    }

    .header-right .size-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}