:root {
    --color-primary: #6495ed;
    --color-primary-light: hsl(202, 92%, 75.49%);
    --color-primary-variant: #87ceeb  ;
    --color-red: #d40f3f;
    --color-red-light: hsl(346, 87%, 46%, 15%);
    --color-green: #ooc476;
    --color-green-light: hsl(156, 100%, 38%, 15%);
    --color-gray-900: #5580cf;
    --color-gray-700: #2d2b7c;
    --color-gray-300: rgba(242, 242, 254, 0.3);
    --color-gray-200: rgba(242, 242, 254, 0.7);
    --color-white: #f2f2fe;
    --color-bg: #f8f8ff ;
    --color-black : #000000;

    --transition: all 300ms ease;

    --container-width-lg: 76%;
    --container-width-md: 95%;
    --form-width: 40%;

    --card-border-radius-1: 0.3rem;
    --card-border-radius-2: 0.5rem;
    --card-border-radius-3: 0.8rem;
    --card-border-radius-4: 2rem;
    --card-border-radius-5: 5rem;
}

/* ========== GENERAL ========== */

bg-biru {
background-color: var(--color-gray-900);
}

* {
   margin: 0;
   padding: 0;
   outline: 0;
   border: 0;
   appearance: 0;
   list-style: none;
   text-decoration: none;
   box-sizing: border-box;
} 

@layer base {
    * {
        all: unset;
        all: revert;
    }
}


body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--color-gray-200);
    overflow-x: hidden;
    background: var(--color-primary);
    font-size: 0.9rem;
}

.container {
    width: var(--container-width-lg);
    max-width: 1800px;
    margin-inline: auto;
}

section {
    margin-top: 3rem;
    width: 100vw;
}

/* add to post on index if there's no featured post. eg. search result page */
/* ADDED AFTER TUTORIAL */
.section__extra-margin {
    margin-top: 7rem;
}

h1, h2, h3, h4, h5{
    color: var(--color-white);
    line-height: 1.3;
}

h1 {
    font-size: 3rem;
    margin: 1rem 0;
}

h2 {
    font-size: 1.7rem;
    margin: 1rem 0;
}

h3{
    font-size: 1.1rem;
    margin: 0.8rem 0 0.5rem;
}

h4{
    font-size: 1rem;
}

a {
    color: var(--color-white);
    transform: var(--transition);
}

img {
    display: block;
    width: 100%;
    object-fit: cover;
}


/* ========== NAV ========== */
nav {
    background: var(--color-primary);
    width: 100vw;
    height: 4.5rem;
    position: fixed;
    top: 0;
    z-index: 10;
    box-shadow: 0 1rem 1rem rgba(0, 0, 0, 0.2)
}


nav button{
    display: none;
}

.nav__container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avastop {
    display: none !important;
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 0.3rem solid var(--color-bg);
    filter: drop-shadow(0 0 0.5rem #000);
    display: none;

}

.nav__logo {
    font-weight: 600;
    font-size: 1.2rem;
}

.logo_container {
    display: flex;
    align-items: center; /* Menyelaraskan logo dan teks secara vertikal */
    justify-content: space-between; /* Mengatur logo dan nama mulai dari kiri */
}

.logo_container div {
    margin-right: 10px; /* Memberikan jarak antara logo dan teks */
}

.logo {
    width: 50px; /* Ukuran logo */
    height: 50px; /* Ukuran logo */
}

.logo_container p {
    font-size: 24px; /* Ukuran teks untuk nama */
    margin: 0; /* Menghilangkan margin default pada <p> */
}

.nav__items {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.nav__profile {
    position: relative;
    cursor: pointer;
}

.nav__profile ul {
    position: absolute;
    top: 140%;
    right: 0;
    display: none;
    flex-direction:column;
    box-shadow: 0 3rem 3rem rgba(0, 0, 0, 0.4);
    visibility: hidden;
    opacity: 0;
    transition: var(--transition)
}

/* show nav ul when nav profile is hovered */
.nav__profile:hover > ul {
    visibility: visible;
    opacity: 1; 
}

.nav__profile ul li a {
    padding: 1rem;
    background: var(--color-gray-900);
    display: block;
    width: 100%;
}

.nav__profile ul li:last-child a {
    background: var(--color-red);
    color: var(--color-bg);
}

/* ========== CATEGORY BUTTON ========== */
.category__button {
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--card-border-radius-2);
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
}

.category__button:hover {
    color: var(--color-white);
}

.btop {
    border-top: 2px solid var(--color-gray-900);
}

/* ========== GENERAL THUMBNAIL ========== */
.post__thumbnail {
    width: 100%;
    height: 220px;
    border-radius: 1rem;
    border: 0.5rem solid var(--color-primary-light);
    overflow: hidden;
    margin-bottom: 1.6rem;
    box-shadow: 0 0 5px 2px rgba(255, 255, 255, 0.3); /* White shadow with lower opacity */
}


.post__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure the image covers the entire container */
}

.post:hover .post__thumbnail img {
    filter: saturate(0);
    transition: filter 500ms ease;
}

.post__author {
    display: flex;
    gap: 1rem;    
    margin-top: 1.2rem;
}

.post__author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--card-border-radius-3);
    overflow: hidden;
    filter: drop-shadow(0 0 0.1rem #fff);
}

.small-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover; /* Agar tetap proporsional tanpa distorsi */
    border-radius: 5px; /* Opsional: buat sedikit membulat */
}


/* ========== FEATURED ========== */
.featured {
    margin-top: 8rem;
}

.featured__container {
    display: grid;

    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}



.featured .post__thumbnail {
    height: fit-content;
}

/* ========== POST ========== */
.post__container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem;
    margin-bottom: 5rem;
}

/* ========== CATEGORY BUTTONS ========== */
.category__buttons{
    padding: 4rem 0;
    border-top: 2px solid var(--color-gray-900);
    border-bottom: 2px solid var(--color-gray-900);
}

.category__buttons-container {
    width: fit-content;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}
/* ========== FOOTER ========== */
footer {
    background: var(--color-gray-900);
    padding: 5rem 0 0;
    box-shadow: inset 0 1.5rem 1.5rem rgba(0, 0, 0, 0.2);
    margin-top: 10rem;
}

.footer__socials {
    margin-inline: auto;
    width: fit-content;
    margin-bottom: 5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
}

.footer__socials a {
    background: var(--color-bg);
    border-radius: 50%;
    width: 2.3rem;
    height: 2.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer__socials a:hover {
    background: var(--color-white);
    color: var(--color-bg);
    transition: all 0.5s ease; /* Add transition property */

}

.footer__container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

footer h4 {
    color: var(--color-white);
    margin-bottom: 0.6rem;
}

footer ul li {
    padding: 0.4rem 0;
}

footer ul a {
    opacity: 0.75;
    transition: all 0.4s ease; /* Add transition property */
}

footer ul a:hover {
    letter-spacing: 0.2rem;
    opacity: 1;
}

.footer__copyright {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 2px solid var(--color-bg);
    margin-top: 4rem;
}

.mshadow {
    box-shadow: inset 0 1.5rem 1.5rem rgba(0, 0, 0, 0.2);
    
}

/* ========== SEARCH ========== */
.search__bar {
    margin-top: 7rem;
}

.search__bar-container {
    position: relative;
    width: 30rem;
    background: var(--color-gray-900);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    padding: 0.6rem 1rem;
    border-radius: var(--card-border-radius-2);
    color: var(--color-gray-300);
}

.search__bar-container > div {
    width: 100%;
    display: flex;
    align-items: center;
}

.search__bar input {
    background: transparent;
    margin-left: 0.7rem;
    padding: 0.5rem 0;
    width: 100%;
}

.search__bar input::placeholder {
    color: var(--color-gray-300);
}


/* ========== BUTTON ========== */
.btn {
    display: flex; /* ubah dari inline-block */
  justify-content: center;
  align-items: center;
    padding: 0.6rem 1.2rem;
    background-color: var(--color-gray-900);
    border-radius: var(--card-border-radius-2);
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-white);
}

.btn.sm {
    padding: 0.3rem 0.7rem;
}

.btn.danger {
    background: var(--color-red);
}

.btn:hover {
    background: var(--color-white);
    color: var(--color-primary);

}

/* ========== SINGLE POST ========== */
.singlepost {
    margin: 6rem 0 2rem;
    border-radius: 2rem;
}

.singlepost__container {
    width: var(--form-width);
    background: var(--color-gray-900);
    padding: 1rem 2rem 3rem;
}

.singlepost__thumbnail {
    margin: 1.5rem 0 1rem;
}

.singlepost__thumbnail img {
    border-radius: 0.5rem;
}

.singlepost__container p {
    margin-top: 1rem;
    line-height: 1.7;
}

/* ========== CATEGORY POST ========== */
.category__title {
    height: 15rem;
    margin-top: 4.5rem;
    background: var(--color-gray-900);
    display: grid;
    place-items: center;
}

/* ========== EMPTY PAGES ========== */
.empty__page {
    height: 70vh;
    display: grid;
    place-content: center;
}

/* ========== GENERAL FORM ========== */
.form__section {
    display: grid;
    place-items: center;
    height: 100vh;
}

.form__section-container {
    width: var(--form-width);
    
}

.alert__massage {
    padding: 0.8rem 1.4rem;
    margin-bottom: 1rem;
    border-radius: 1rem;
    border-radius: var(--card-border-radius-2);
}

.alert__massage.error {
    background: var(--color-red-light);
    color: var(--color-red);
}

.alert__massage.success {
    background: var(--color-green-light);
    color: var(--green-red);
}

.alert__massage.lg {
    text-align: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form__control {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.form__control.inline {
    flex-direction: row;
    align-items: center;
}

input, textarea, select {
    padding: 0.8rem 1.4rem;
    background-color: var(--color-bg);
    border-radius: var(--card-border-radius-2);
    resize: none;
    color: var(--color-black);
}

.form__section small {
    margin-top: 1rem;
    display: block;
}

.form__section small a {
    color: var(--color-primary);
}


/* ========== DASHBOARD ========== */
.dashboard {
    margin-top: 6rem;
}

.dashboard__mt {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }

.sidebar__toggle {
    display: none;
}

.dashboard__container {
    display: grid;
    grid-template-columns: 14rem auto;
    gap: 1rem;
    background: var(--color-gray-900);
    padding: 2rem;
    margin-bottom: 5rem;
}

.ignore_gap{
    gap: 0rem;
}

.admin__container {
    display: grid;
    grid-template-columns: 14rem auto;
    gap: 1rem;
    background: var(--color-gray-900);
    padding: 2rem;
}

.logout-item {
    background-color: #ef4444 !important;
  }
  

.dashboard aside a {
    background: var(--color-primary);
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.6rem;
}

.dashboard aside ul li:not(:last-child) {
    border-bottom: 1px solid var(--color-gray-900);
}

.dashboard aside a:hover {
    background: var(--color-gray-900);
}

.dashboard aside a.active {
    background-color: var(--color-gray-900);
}

.dashboard main {
    margin-left: 1.5rem;
}

.dashboard main h2 {
    margin: 0 0 2rem 0;
    line-height: 1;
}

.dashboard main table {
    width: 100%;
    text-align: left;
}

.dashboard main table th {
    background: var(--color-primary);
    padding: 0.8rem;
    color: var(--color-white);
}

.dashboard main table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--color-gray-200);
}


/* ========== CONTACT US ========== */
.contact {
    position: relative;
    min-height: 100vh;
    padding: 50px 100px;
    display: flex;
    justify-content: center;
    align-items: center ;
    justify-items: center;
    flex-direction: column;
}

.contact .content {
    max-width: 800px;
    text-align: center;
}

.contact .content h2 {
    font-size: 36px;
    font-weight: 500;
    color: #fff;
}

.contact .content p span {
    color: #00bcd4;
}

.contact__container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.contact__container .contactInfo {
    width: 50%;
    display: flex;
    flex-direction: column;
}

.contact__container .contactInfo .box {
    position: relative;
    padding: 20px 0;
    display: flex;
}

.contact__container .contactInfo .box .icon {
    min-width: 60px;
    height: 60px;
    background: var(--color-primary-light);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 22px;
}

.contact__container .contactInfo .box .text {
    display: flex;
    margin-left: 20px;
    font-size: 16px;
    color: #fff;
    flex-direction: column;
    font-weight: 300;
}

.contact__container .contactInfo .box .text h3 {
    font-weight: 500;
    color: #00bcd4;
}

.contactForm {
    width: 40%;
    padding: 40px;
    background: #fff;
    border-radius: 10px;
    margin-left: 4rem;
}

.contactForm h2 {
    font-size: 30px;
    color: #333;
    font-weight: 500;
}

.contactForm .inputBox {
    position: relative;
    background: #fff;
    width: 100%;
    margin-top: 10px;
    display: flex;
    justify-content: flex-end; /* Aligns the button to the right */
}

.contactForm .inputBox input,
.contactForm .inputBox textarea {
    width: 100%;
    padding: 5px 0;
    font-size: 16px;
    margin: 10px 0;
    background: #fff; /* Set background color to white */
    border: none;
    border-bottom: 2px solid #000; /* Set underline color to black */
    outline: none;
    resize: none;
    color: #000; /* Set text color to black */
    border-radius: inherit;
}

.contactForm .inputBox input:focus,
.contactForm .inputBox textarea:focus {
    border-bottom-color: #000; /* Maintain black underline on focus */
}

.contactForm .inputBox span {
    position: absolute;
    left: 0;
    padding: 5px 0;
    font-size: 16px;
    margin: 10px 0;
    pointer-events: none;
    transition: 0.5s;
    color: #666;
    margin-top: -0.1rem;
}

.contactForm .inputBox input:focus ~ span,
.contactForm .inputBox input:valid ~ span,
.contactForm .inputBox textarea:focus ~ span,
.contactForm .inputBox textarea:valid ~ span {
    color: #000;
    font-size: 12px;
    transform: translateY(-20px);
}

.contactForm .inputBox input[type="submit"] {
    width: 100px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 18px;
    border-radius: 5px; /* Adds border radius to the button */
}

/* ========== PROFILE ========== */

.profile__system {
    padding: 100px;
    background-image: linear-gradient(-20deg, #ff2846 0%, #6944ff 100%);
    text-align: center;
}

.ava {
    width: 800px;
    height: auto;
    background-color: #fafafa;
    margin: 0 auto;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #eeeeee;
    margin-top: 3rem;
    text-align: center;
}

.ava__img {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%; /* Make the image container circular */
    filter: drop-shadow(0 0 0.5rem #000);
}

.ava h1 {
    font-size: 30px;
    margin: 0;
    font-weight: bold;
    color: #6944ff;
}

.ava .ava__text {
    font-size: 15px;
    margin: 0;
    color: #324e63;
}

.ava p {
    margin: 0 auto;
    padding-top: 20px;
    width: 450px;
    color: #324e63;
}



/* ========== MEDIA QUERIES (MEDIUM DEVICES) ========== */
@media screen and (max-width: 1024px) {
    /* ========== GENERAL ========== */
    .container {
        width: var(--container-width-md);
    }

    h2{
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h5 {
        font-size: 0.8rem;
    }

    /* ========== NAV ========== */
    nav button {
        display: inline-block;
        font-size: 1.5rem;
        background: transparent;
        color: var(--color-white);
        cursor: pointer;
    }

    nav button#close__nav-btn {
        display: none;
    }

    .nav__container {
        position: relative;
    }

    .nav__items {
        position: absolute;
        flex-direction: column;
        top: 100%;
        right: 0;
        width: 12rem;
        align-items: flex-start;
        justify-content: center;
        gap: 0;
        display: none;
    }

    .nav__items li {
        width: 100%;
        height: 4rem;
        display: flex;
        align-items: center;
        box-shadow: -2rem 3rem 7rem rgba(0, 0, 0, 0.7);
        background: var(--color-gray-900);
        border-top: 1px solid var(--color-bg);
        animation: animateDropdown 1200ms 0s ease forwards;
        opacity: 0;
        transform-origin: top;
    }

    .nav__items li:nth-child(2) {
        animation-delay: 200ms;
    }
    .nav__items li:nth-child(3) {
        animation-delay: 400ms;
    }
    .nav__items li:nth-child(4) {
        animation-delay: 600ms;
    }
    .nav__items li:nth-child(5) {
        animation-delay: 800ms;
    }
    .nav__items li:nth-child(6) {
        animation-delay: 1000ms;
    }

    /* Blink Animation */
    @keyframes blink {
        0%, 100% {
            color: #6B7280; /* text-gray-500 */
        }
        50% {
            color: #FFFFFF; /* text-white */
        }
    }
    
    .animate-blink {
        animation: blink 1s infinite;
    }
    

    /* nav dropdown animation */
    @keyframes animateDropdown {
        0% {
            transform: rotateX(90deg);
        }
        100%{
            transform: rotateX(0deg);
            opacity: 1;
        }
    }

    .nav__items li a {
        border-radius: 0;
        width: 100%;
        height: 100%;
        background: var(--color-gray-900);
        padding: 0 2rem;
        display: flex;
        align-items: center;
    }

    .nav__profile {
        background: var(--color-gray-900);
    }

    .nav__profile ul {
        top: 100%;
        width: 100%;
        margin-top: 0.9rem;
    }

    .nav__profile .avatar {
        margin-left: 2rem;
        border: 0;
    }

    .featured__container {
        gap: 3rem;
    }

    .post__container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer__container {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    /* ========== BLOG ========== */
    .search__bar-container {
        width: 60%;
    }

    /* ========== GENERAL FORM ========== */
    .form__section-container {
        padding : 3rem;
    }

    /* ========== DASHBOARD ========== */
    /* .dashboard__container {
        grid-template-columns: 4.3rem auto;
        padding: 0;
        background: transparent;
    }

    .dashboard aside h5 {
        display: none;
    }

    .dashboard main table thead {
        display: none;
    }

    .dashboard main table tr {
        display: flex;
        flex-direction: column;
    }

    .dashboard main table tr:nth-child(even) 
    {
        background: var(--color-gray-900);
    }

    .dashboard main table tr:hover td {
        background: transparent;
    } */

    .post__thumbnail {
        height: 300px; /* Adjust height for medium screens */
    }

    /* ========== CONTACT ========== */
    .contact {
        padding: 50px;
    }

    .contact__container {
        width: 115%;
        margin-top: 50px;
    }

    .contact__container .contactInfo {
        margin-right: 2rem;
    }

    .contact__container .contactInfo {
        width: 40%;
        padding: 20px;
        margin-left: -7rem;
    }

    .contactForm {
        margin-left: 0;
    }


    /* ========== Profile ========== */

    .ava {
        width: 100%;
        padding: 10px;
    }

    .ava p {
        width: 100%;
        padding: 10px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        width: var(--container-width-md);
    }

}


/* ========== MEDIA QUERIES (SMALL DEVICES) ========== */

@media screen and (max-width: 600px) {
    section {
        margin-top: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    .featured {
        margin-top: 6rem;
    }

    .featured__container {
        grid-template-columns: 1fr;
        gap: 0rem;
    }

    .nav__profile ul {
        margin-top: 0;
    }

    .post__container {
        grid-template-columns: 1fr;
    }

    .category__buttons-container {
        grid-template-columns: 1fr 1fr;
    }

    .footer__container {
        grid-template-columns: 1fr;
        text-align: center;
        align-items: center;
        gap: 2rem;
    }

    /* ========== BLOG ========== */
    .search__bar-container {
        width: var(--container-width-md);
    }

    /* ========== SINGLE POST ========== */
    .singlepost__container {
        background-color: transparent;
        padding: 0 ;
    }

    /* ========== GENERAL FORM ========== */
    .form__section-container {
        padding : 0;
    }

    /* ========== DASHBOARD ========== */
    .dashboard {
        margin-top: 5rem;
    }

    .dashboard__container {
        grid-template-columns: 1fr;
        gap: 0;
        background: transparent;
    }

    .dashboard main {
        margin: 0;
    }

    .dashboard main h2 {
        margin-top: 1rem;
    }

    .dashboard aside {
        position: fixed;
        box-shadow: 2rem 0 4rem rgba(0, 0, 0, 0.4);
        left: -100%;
        height: 100vh;
        transition: var(--transition);
        background: var(--color-primary);
    }
    
    .dashboard .sidebar__toggle {
        display: inline-block;
        background: var(--color-primary-variant);
        color: var(--color-white);
        position: fixed;
        right: 0;
        bottom: 4rem;
        z-index: 1;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50% 0 0 50%;
        font-size: 1.3rem;
        cursor: pointer;
        box-shadow: -1rem 0 2rem rgba(0, 0, 0, 0.4);
    }

    .dashboard aside a h5 {
        display: inline-block;
    }

    .dashboard main table thead {
        display: none;
    }

    .dashboard main table tr {
        display: flex;
        flex-direction: column;
    }

    .dashboard main table tr:nth-child(even) 
    {
        background: var(--color-gray-900);
    }

    .dashboard main table tr:hover td {
        background: transparent;
    }

    #hide__sidebar-btn {
        display: none;
    }

    .post__thumbnail {
        height: 240px;
    }

    /* ========== CONTACT ========== */
    .contact {
        padding: 50px;
    }

    .contact__container {
        flex-direction: column;
    }

    .contact__container .contactInfo {
        margin-bottom: 40px;
        margin-right: 1rem;
    }

    .contact__container .contactInfo {
        width: 100%;
        margin-right: -5rem;
    }

    .contactForm {
        width: 80%;
        margin-right: 3rem;
    }

    /* ========== PROFILE ========== */

    .profile__system {
        padding: 50px;
    }

    .ava__img {
        width: 100px;
        height: 100px;
    }

    .ava h1 {
        font-size: 24px;
    }

    .ava .ava__text {
        font-size: 14px;
    }

    .ava p {
        font-size: 14px;
    }
    

}