@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400&display=swap');

* {
    margin: 0;
    padding: 0;
    font-family: Roboto, sans-serif;
}
:root {
    --p-text-color: rgb(121, 121, 121);
    --header-section-color: #fff;
    --sidebar-section-color: #155e75;
    --main-content-color: #cffafe;
    --box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
}
.container {
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 5fr;
    grid-template-rows: 1fr 5fr;
    grid-template-areas: 
        "sidebar header"
        "sidebar main-content";
}


/* ///// Header \\\\\ */
.header {
    background-color: var(--header-section-color);
    grid-area: header;
    display: grid;
    padding: 20px;
    box-shadow: var(--box-shadow);
    z-index: 1;
}
.header-search-container, .user-info-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.search-bar {
    display: grid;
    grid-template-columns: 50px 1fr;
}
.search-bar input {
    border-radius: 25px;
    padding: 0 20px;
    border: none;
    outline: none;
    background-color: #E2E8F0;
    height: 70%;
    align-self: center;
}
.search-bar img, .user img:first-child {
    width: 25px;
    align-self: center;
    justify-self: center;
}

.user {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.user img:first-child {
    justify-self: flex-end;
}
.user span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.user img:last-child {
    width: 50px;
}

.user-info-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 20px 20px 0px 20px;
}
.user-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px;
}
.user-info p {
    display: grid;
    font-size: clamp(18px, 20px, 22px);
    font-weight: bold;
}
.user-info p span {
    font-size: 13px;
    align-self: center;
}
.user-info img {
    width: 70px;
}
.user-nav {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    align-items: center;
    gap: 20px;
}
.user-nav button {
    background-color: var(--sidebar-section-color);
    border-radius: 25px;
    color: white;
    border: none;
    font-size: 15px;
    width: 100px;
    height: 35px;
}
.user-nav button:hover {
    cursor: pointer;
    opacity: 0.9;
}
.user-nav button:first-child {
    justify-self: end;
}
.user-nav button:nth-child(2) {
    justify-self: center;
}
.user-nav button:last-child {
    justify-self: start;
}


/* ///// Sidebar \\\\\ */
.sidebar {
    background-color: var(--sidebar-section-color);
    grid-area: sidebar;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 50px 300px 150px;
    gap: 45px;
    padding: 20px;
}
.logo img {
    width: 50px;
    fill: white;
}
.logo a {
    display: grid;
    grid-template-columns: 70px 1fr;
    justify-content: start;
    align-items: center;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 25px;
}

.side-nav {
    display: grid;
}
.side-nav li {
    list-style: none;
}
.side-nav li a {
    text-decoration: none;
    color: white;
    font-size: 18px;
    display: grid;
    grid-template-columns: 50px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-radius: 10px;
}
.side-nav li a img {
    width: 25px;
    justify-self: center;
}
.side-nav li a:hover {
    background-color: rgba(246, 247, 250, 0.2);
}


/* ///// Main Content \\\\\ */
.main-content {
    background-color: var(--main-content-color);
    grid-area: main-content;
    display: grid;
    grid-template-columns: 4fr 1fr;
    padding: 25px 10px;
}
.card-container {
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 0 20px;
    gap: 10px;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-template-rows: minmax(auto, 1fr);
    gap: 25px;
    height: fit-content;
    width: fit-content;
}
.card-container > h3 {
    grid-column: 1 / -1;
}
.card {
    border-radius: 10px;
    background-color: white;
    box-shadow: var(--box-shadow);
    width: 100%;
    height: 200px;
    position: relative;
    padding: 30px;
    box-sizing: border-box;
    display: grid;
}
.card::before {
    content: "";
    width: 7px;
    height: 100%;
    background-color: var(--sidebar-section-color);
    position: absolute;
    left: 0;
    top: 0;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.card-content h4 {
    padding-bottom: 3px;
}
.card-buttons {
    display: flex;
    align-self: center;
    justify-self: end;
    gap: 20px;
    padding-top: 10px;
}
.card-buttons button {
    border: none;
    background-color: transparent;
}
.card-buttons button:hover {
    cursor: pointer;
}
.card p {
    font-size: 14px;
    color: var(--p-text-color);
}
.card-buttons img {
    width: 25px;
}
.news-feed {
    display: grid;
    gap: 40px;
    margin-right: 20px;
    grid-template-rows: auto 1fr;
}
.annoucements {
    display: grid;
    grid-template-rows: auto 1fr;   
    gap: 10px;
}
.annoucements-card-container {
    padding: 30px;
    border-radius: 10px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: fit-content;
    box-shadow: var(--box-shadow);
}
.annoucement-card h5 {
    padding-bottom: 3px;
    font-size: 14px;
}
.annoucement-card p {
    font-size: 13px;
    color: var(--p-text-color);
}
.annoucements-card-container hr {
    opacity: 0.3;
}
.trending {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px;
}
.trending-card-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    box-shadow: var(--box-shadow);
}
.trending-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
}
.trending-card p {
    display: grid;
    font-size: 14px;
    color: var(--p-text-color);
}
.trending-card span {
    font-size: 15px;
    color: black;
    align-self: end;
}
.trending-card img {
    width: 50px;
}

@media only screen and (max-width: 1162px) {
    .main-content {
        grid-template-columns: 3fr 1fr;
    }
    .sidebar {
        padding: 20px 0;
    }
    .sidebar span {
        display: none;
    }
    .container {
        grid-template-columns: 100px 5fr;
    }
    .side-nav {
        grid-template-columns: 1fr;
    }
    .side-nav li a {
        grid-template-columns: 1fr;
    }
    .side-nav li a img {
        width: 30px;
    }
    .side-nav {
        align-items: center;
        justify-content: center;
    }
    .logo a {
        grid-template-columns: 1fr;
        justify-items: center;
    }
}

@media only screen and (max-width: 1060px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
    }
    .trending-card-container {
        grid-template-rows: repeat(4, max-content);
        height: fit-content;
    }
    .trending-card p {
        padding: 5px 0;
        height: fit-content;
    }
}

@media only screen and (max-width: 950px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 5fr;
        grid-template-areas: 
        "header"
        "main-content";
    }
    .user-nav button {
        width: 80px;
        font-size: 14px;
    }
    .user-info p {
        font-size: 18px;
    }
    .user-info p span {
        font-size: 12px;
    }
    .user span {
        font-size: 15px;
    }
    .user-info-container {
        grid-template-columns: 3fr 1fr;
        padding: 15px 15px 0 15px;
    }
    .user-info img {
        width: 65px;
    }
    .sidebar {
        gap: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 15px;
        z-index: 1;
    }
    .logo {
        display: none;
    }
    .side-nav {
        display: flex;
        gap: 10px;
    }
    .side-nav:first-child {
        width: 150%;
    }
    .side-nav li a {
        display: flex;
        align-items: center;
        width: 70px;
        justify-content: center;
    }
}

@media only screen and (max-width: 760px) {
    .trending-card-container {
        padding: 15px;
    }
    .trending-card p {
        font-size: 13px;
    }
    .trending-card span {
        font-size: 14px;
    }

    .annoucements-card-container {
        padding: 20px;
    }
    .annoucement-card h5 {
        font-size: 13px;
    }
    .annoucement-card p {
        font-size: 12px;
    }
    .user-nav button {
        width: 70px;
        height: 30px;
    }
    .user-info-container {
        gap: 10px;
    }
}

@media only screen and (max-width: 600px) {
    .sidebar {
        height: 25px;
    }
    .side-nav li a {
        width: 55px;
    }
    .side-nav li a img {
        width: 35px;
    }
}