/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

body {
    font-family: "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #141e30, #243b55);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* NAVBAR */
nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: top 0.3s ease-in-out;
}

nav .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #ff4b5c;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 10px 0;
    padding-left: 0;
    gap: 10px;
}

nav ul li a {
    text-decoration: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: block;
}

nav ul li a:hover,
nav ul li a.active {
    background: #ff4b5c;
    box-shadow: 0 0 10px rgba(255, 75, 92, 0.6);
}

/* SEARCH BOX */
.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    overflow: hidden;
    margin-top: 10px;
}

.search-box input {
    padding: 8px 12px;
    border: none;
    outline: none;
    background: transparent;
    color: white;
    width: 150px;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-box button {
    padding: 8px 12px;
    border: none;
    background: #ff4b5c;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-box button:hover {
    background: #ff2c40;
}

/* NEWS CONTAINER */
#newsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 25px;
    animation: fadeIn 0.5s ease;
}

/* NEWS CARD */
.news-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transform: translateY(0);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.news-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.news-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-card:hover img {
    transform: scale(1.05);
}

.news-card .content {
    padding: 15px;
}

.news-card h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #fff;
}

.news-card p {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

/* SKELETON LOADING */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 10px;
}

.skeleton-img {
    height: 180px;
}

.skeleton-text {
    height: 15px;
    margin: 8px 0;
}

@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }
    nav ul {
        justify-content: flex-start;
        width: 100%;
    }
    .search-box {
        width: 100%;
        justify-content: space-between;
    }
    .search-box input {
        width: 100%;
    }
}

@media (max-width: 600px) {
    #newsContainer {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    nav ul {
        flex-direction: column;
        align-items: flex-start;
    }
    nav ul li {
        width: 100%;
    }
    nav ul li a {
        width: 100%;
        text-align: left;
    }
}
@media (max-width: 400px) {
    nav {
        padding: 10px 15px;
    }
    .search-box input {
        width: 120px;
    }
    .news-card h3 {
        font-size: 1em;
    }
    .news-card p {
        font-size: 0.85em;
    }
}