* {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
}

html {
    overflow-x: hidden;
}

body {
    background-color: #1d1c1b;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
p,
a {
    font-family: 'Noto Kufi Arabic', sans-serif;
}

header {
    min-height: 40vh;
    background: linear-gradient(rgba(0, 0, 0, 0.2), #fafafa), url(/assets/img/Articles/Articless.jpg);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: bottom;
    background-size: cover;
}



.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.articles-settings {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sorting {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sorting p {
    color: #e0e0e0;
    font-weight: 500;
}

.sorting select {
    background: rgba(44, 129, 163, 0.2);
    border: 2px solid #2C81A3;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sorting select:hover {
    background: rgb(44, 129, 163);
    transform: translateY(-2px);
}

.sorting select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 129, 163, 0.3);
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px;
}

.view-btn {
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 16px;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.view-btn.active {
    background: #2C81A3;
    box-shadow: 0 4px 15px rgba(44, 129, 163, 0.3);
}

.loading {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #7a7a7a;
}

.loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.articles-container {
    display: grid;
    gap: 25px;
    transition: all 0.5s ease;
}

/* Grid Layout */
.articles-container.grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* List Layout */
.articles-container.list {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin: 0 auto;
}

.article-card {
    background: linear-gradient(145deg, #1e1e1e, #141313);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(44, 129, 163, 0.1), rgba(197, 65, 43, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.article-card:hover::before {
    opacity: 1;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: #2C81A3;
}

.article-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.5s ease;
}

.article-card:hover img {
    transform: scale(1.05);
}

.article-content {
    padding: 20px;
    position: relative;
    z-index: 2;
}

.article-card h2 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.article-card:hover h2 {
    color: #2C81A3;
}

.article-card p {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.article-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.read-more {
    color: #2C81A3;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: #4da3c7;
    transform: translateX(-5px);
}

/* List specific styles */
.articles-container.list .article-card {
    display: flex;
    align-items: stretch;
    max-height: 250px;
}

.articles-container.list .article-card img {
    width: 300px;
    height: 100%;
    flex-shrink: 0;
}

.articles-container.list .article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.articles-container.list .article-card h2 {
    font-size: 22px;
    margin-bottom: 15px;
}

.articles-container.list .article-card p {
    font-size: 16px;
    flex: 1;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #7a7a7a;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #2C81A3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .articles-settings {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .view-toggle {
        display: none;
    }

    .articles-container.grid {
        grid-template-columns: 1fr;
    }

    .articles-container.list .article-card {
        flex-direction: column;
        max-height: none;
    }

    .articles-container.list .article-card img {
        width: 100%;
        height: 200px;
    }

    .articles-container.list .article-card h2 {
        font-size: 18px;
    }

    .articles-container.list .article-card p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .articles-settings {
        padding: 15px;
    }

    .article-content {
        padding: 15px;
    }
}

/* Animation for layout changes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search functionality (bonus feature) */
.search-container {
    width: 100%;
    margin-bottom: 20px;
}

.search-box {
    max-width: 100%;
    width: 96.5%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: #2C81A3;
    box-shadow: 0 0 0 3px rgba(44, 129, 163, 0.2);
}

.search-box::placeholder {
    color: #7a7a7a;
}