/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;

    background: #f5f6f8;

    color: #222;

    line-height: 1.6;
}

img {
    max-width: 100%;
}


/* =========================================================
   CONTAINER
========================================================= */

.container {
    width: 92%;

    max-width: 1400px;

    margin: auto;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    background: #111827;

    color: white;

    padding: 18px 0;

    position: sticky;
    top: 0%;
     z-index: 2000; 
}

.header-content {
    display: flex;

    justify-content: space-between;

    align-items: center;
}

.logo {
    color: white;

    text-decoration: none;

    font-size: 22px;

    font-weight: bold;
}

.site-header nav {
    display: flex;

    align-items: center;

    gap: 20px;
}

.site-header nav a {
    color: white;

    text-decoration: none;
}

.site-header nav a:hover {
    text-decoration: underline;
}


/* =========================================================
   MAIN
========================================================= */

main {
    min-height: calc(100vh - 140px);

    padding: 60px 0;
}

.page-title {
    margin-bottom: 40px;
}

.page-title h1 {
    font-size: 40px;

    margin-bottom: 5px;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-block;

    background: #2563eb;

    color: white;

    padding: 11px 20px;

    border: none;

    border-radius: 5px;

    text-decoration: none;

    cursor: pointer;

    font-size: 16px;

    transition: 0.2s;
}

.btn:hover {
    background: #1d4ed8;
}

.logout-btn {
    display: inline-block;

    background: #dc2626;

    color: white;

    padding: 8px 15px;

    border-radius: 5px;

    text-decoration: none;
}

.logout-btn:hover {
    background: #b91c1c;
}


/* =========================================================
   FORMS
========================================================= */

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;

    padding: 13px;

    border: 1px solid #ccc;

    border-radius: 6px;

    font-size: 16px;

    font-family: inherit;
}

.form-group textarea {
    resize: vertical;

    min-height: 250px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}

.article-form {
    max-width: 900px;

    background: white;

    padding: 40px;

    border-radius: 10px;

    box-shadow:
        0 3px 15px rgba(0,0,0,0.08);
}


/* =========================================================
   MESSAGES
========================================================= */

.error-message {
    color: #dc2626;

    background: #fee2e2;

    padding: 12px;

    border-radius: 5px;

    margin-bottom: 20px;
}

.success-message {
    color: #166534;

    background: #dcfce7;

    padding: 12px;

    border-radius: 5px;

    margin-bottom: 20px;
}


/* =========================================================
   DASHBOARD
========================================================= */

.dashboard-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 25px;

    margin-bottom: 40px;
}

.dashboard-cards {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 25px;

    margin-bottom: 50px;
}

.dashboard-card {
    background: white;

    padding: 30px;

    border-radius: 10px;

    box-shadow:
        0 3px 12px rgba(0,0,0,0.08);
}

.dashboard-card h3 {
    font-size: 18px;
}

.dashboard-card p {
    font-size: 42px;

    font-weight: bold;

    color: #2563eb;

    margin-top: 10px;
}


/* =========================================================
   ADMIN ARTICLE GRID
========================================================= */

.articles-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 25px;
}

.article-card {
    background: white;

    border-radius: 10px;

    overflow: hidden;

    box-shadow:
        0 3px 12px rgba(0,0,0,0.08);

    transition: 0.25s;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-card img {
    width: 100%;

    height: 230px;

    object-fit: cover;

    display: block;
}

.article-card-content {
    padding: 20px;
}

.article-card-content h2 {
    font-size: 20px;

    line-height: 1.3;

    margin-bottom: 8px;
}

.article-card-content a,
.article-card > a {
    color: #111;

    text-decoration: none;
}


/* =========================================================
   EDIT / DELETE
========================================================= */

.article-actions {
    display: flex;

    gap: 10px;

    padding: 0 20px 20px;
}

.article-actions .btn,
.delete-btn {
    flex: 1;

    text-align: center;
}

.delete-btn {
    background: #dc2626;

    color: white;

    padding: 11px 20px;

    border-radius: 5px;

    text-decoration: none;
}

.delete-btn:hover {
    background: #b91c1c;
}


/* =========================================================
   FULL ARTICLE
========================================================= */

.full-article {
    max-width: 950px;

    margin: auto;

    background: white;

    padding: 50px;

    border-radius: 10px;

    box-shadow:
        0 3px 15px rgba(0,0,0,0.08);
}

.full-article h1 {
    font-size: 42px;

    line-height: 1.2;

    margin-bottom: 15px;
}

.full-article img {
    width: 100%;

    max-height: 550px;

    object-fit: cover;

    border-radius: 8px;

    margin: 25px 0;
}

.article-content {
    font-size: 18px;

    line-height: 1.8;
}

.article-content p {
    margin-bottom: 20px;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    background: #111827;

    color: white;

    text-align: center;

    padding: 25px 0;
}


/* =========================================================
   LOGIN
========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    background: #111827;

    padding: 20px;
}

.login-container {
    width: 100%;

    max-width: 450px;
}

.login-box {
    background: white;

    padding: 40px;

    border-radius: 10px;

    box-shadow:
        0 10px 35px rgba(0,0,0,0.25);
}

.login-box h1 {
    text-align: center;

    margin-bottom: 10px;
}

.login-subtitle {
    text-align: center;

    color: #666;

    margin-bottom: 30px;
}


/* =========================================================
   LARGE DESKTOP
========================================================= */

@media (min-width: 1600px) {

    .container {
        max-width: 1500px;
    }

    .articles-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

}


/* =========================================================
   LAPTOP / SMALL DESKTOP
========================================================= */

@media (max-width: 1199px) {

    .container {
        width: 90%;
    }

    .articles-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 991px) {

    main {
        padding: 45px 0;
    }

    .header-content {
        gap: 20px;
    }

    .site-header nav {
        gap: 12px;
    }

    .articles-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .full-article {
        padding: 35px;
    }

}


/* =========================================================
   PHONE
========================================================= */

@media (max-width: 767px) {

    .container {
        width: 92%;
    }

    .header-content {
        flex-direction: column;

        align-items: center;

        text-align: center;
    }

    .site-header nav {
        width: 100%;

        justify-content: center;

        flex-wrap: wrap;

        gap: 12px;
    }

    main {
        padding: 35px 0;
    }

    .page-title h1 {
        font-size: 32px;
    }

    .dashboard-header {
        flex-direction: column;

        align-items: flex-start;
    }

    .dashboard-header .btn {
        width: 100%;

        text-align: center;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-actions {
        flex-direction: column;
    }

    .article-actions .btn,
    .delete-btn {
        width: 100%;
    }

    .full-article {
        padding: 25px 20px;
    }

    .full-article h1 {
        font-size: 30px;
    }

    .article-content {
        font-size: 16px;
    }

    .article-form {
        padding: 25px 20px;
    }

}


/* =========================================================
   SMALL PHONE
========================================================= */

@media (max-width: 480px) {

    .container {
        width: 94%;
    }

    .login-box {
        padding: 25px 20px;
    }

    .page-title h1 {
        font-size: 27px;
    }

    .dashboard-card {
        padding: 22px;
    }

    .dashboard-card p {
        font-size: 35px;
    }

    .article-card img {
        height: 200px;
    }

    .full-article {
        padding: 20px 15px;
    }

    .full-article h1 {
        font-size: 25px;
    }

    .article-form {
        padding: 20px 15px;
    }

}