/**  

I am the styles.css file, create to make the CMU Database Research Group's website look good. 
While Bootstrap v5 provides a strong foundation, I am here to add those extra touches 
and customizations that make the website truly unique.

**/

/* ##################### COMMON STYLING START ##################### */

:root {
    --navbar-height-sm: calc(3rem + 0.25rem);
    --navbar-height-md: calc(3rem + 0.5rem);
    --navbar-height-lg: calc(3rem + 1rem);
}

html {
    scroll-padding-top: var(--navbar-height-sm);
}

a:link {
    text-decoration: none;
}

a {
    color: #c41230;
}

p:empty {
  display: none;
}


@media (min-width: 768px) {
    html {
        scroll-padding-top: var(--navbar-height-md);
    }
}

@media (min-width: 992px) {
    html {
        scroll-padding-top: var(--navbar-height-lg);
    }
}

body {
    /* background: url('./svg-back-db.svg'); */
    background: #f3f3f3;
    color: #000000;
}

@media (min-width: 1200px) {
    .container {
        padding-left: 7rem !important;
        padding-right: 7rem !important;
    }
}

/* Replacing bootstrap red with cmu-red */
.bg-danger {
    background-color: #c41230 !important;
}

.bg-cmu-black {
    background-color: #000000;
}

.bg-cmu-iron-grey {
    background-color: #6d6e71;
}

.bg-cmu-steel-grey {
    background-color: #e0e0e0;
}

.text-cmu-red {
    color: #c41230 !important;
}

.text-cmu-steel-grey {
    color: #e0e0e0 !important;
}

.text-cmu-iron-grey {
    color: #6d6e71 !important;
}

.text-hover-red:hover {
    color: #c41230 !important;
}

.text-hover-cmu-iron-grey:hover {
    color: #6d6e71 !important;
}

tr:target, div:target {
    background-color: #f0e65f !important;
    border: 3px solid #C41230;
}

/* Buttons */
.view-all-btn-large {
    background-color: #000000;
    color: #e0e0e0;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.view-all-btn-large:hover {
    background-color: #6d6e71;
    color: #e0e0e0;
}

.view-all-btn-large .bi {
    transition: transform 0.3s ease;
}

.view-all-btn-large:hover .bi {
    transform: translateX(8px);
}

.animate-link {
    transition: all 0.3s ease;
}
.animate-link .bi {
    transition: transform 0.3s ease;
}
.animate-link:hover .bi {
    transform: translateX(8px);
}

/* Change class name to read-more-btn later */
.read-more {
    color: #c41230 !important;
    text-decoration: none;
    display: inline-flex;
}

.read-more:hover {
    color: brown !important;
}

.read-more:active {
    color: #6d6e71 !important;
}

.read-more .bi {
    transition: transform 0.3s ease;
}

.read-more:hover .bi {
    transform: translateX(8px);
}

.accordion-button {
    font-size: x-large;
    outline: none !important;
    box-shadow: none !important;
    background-color: white;
    font-weight: bold;
}

.accordion-button:not(.collapsed) {
    background-color: #e0e0e0;
    color: #c41230;
}

/* ##################### COMMON STYLING END ##################### */

/* ##################### NAVBAR START ##################### */

/* NAVBAR Links */

.navbar-nav .nav-item .nav-link {
    font-weight: bold;
    color: #e0e0e0;
    transition: 0s ease;
}

.navbar-nav .nav-item .nav-link:hover {
    background-color: #c41230;
    color: #e0e0e0;
    border-radius: 0.5rem;
    cursor: pointer;
}

.navbar-nav .current-menu-item .nav-link {
    background-color: #e0e0e0;
    color: black;
    border-radius: 0.5rem;
    cursor: pointer;
}

@media (max-width: 992px) {
    .navbar-nav .nav-item .nav-link {
        font-size: small;
    }
}

@media (max-width: 768px) {
    .navbar-nav .nav-item {
        margin-top: 0.75rem;
        animation: navLinkFade 0.5s ease forwards 0s;
        transition: transform 0.5s ease;
    }

    .navbar-nav .nav-item .nav-link:hover {
        display: inline-block;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .navbar-nav .current-menu-item .nav-link {
        display: inline-block;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0px);
    }
}

#mobile-search-input {
    outline: none;
    width: 20rem;
}

@media (max-width: 412px) {
    #mobile-search-input {
        outline: none;
        width: 15rem;
    }
}

@media (max-width: 331px) {
    #mobile-search-input {
        outline: none;
        width: 7rem;
    }
}

#navbar-desktop-search-form .btn {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

#navbar-desktop-search-form .btn:hover {
    background-color: #c41230 !important;
}

#navbar-mobile-search-form .btn {
    padding-left: 5px !important;
    padding-right: 5px !important;
}

#navbar-mobile-search-form .btn:hover {
    background-color: #c41230 !important;
}

/* NAVBAR logo of CMU DataBase Group */

/* Note: The chosen media max-width ensures better responsiveness across various 
screen sizes, independent of the bootstrap grid system. */

.navbar-logo {
    max-width: 220px;
}

@media (max-width: 992px) {
    .navbar-logo {
        max-width: 200px;
    }
}

@media (max-width: 840px) {
    .navbar-logo {
        max-width: 162px;
    }
}

@media (max-width: 320px) {
    .navbar-logo {
        max-width: 128px;
    }
}

@media (max-width: 248px) {
    .navbar-logo {
        max-width: 80px;
    }
}

/* NAVBAR Hamburger menu animation  */

.navbar-toggler,
.navbar-toggler:focus,
.navbar-toggler:active {
    outline: none;
    border: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .nav-menu-icon {
        width: 30px;
        height: 20px;
        position: relative;
        transform: rotate(0deg);
        transition: 0.5s ease-in-out;
    }

    .nav-menu-icon span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: #e0e0e0;
        border-radius: 9px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: 0.35s ease-in-out;
    }

    .nav-menu-icon .top-bar {
        top: 0px;
    }

    .nav-menu-icon .middle-bar-1,
    .nav-menu-icon .middle-bar-2 {
        top: 8px;
    }

    .nav-menu-icon .bottom-bar {
        top: 16px;
    }

    .nav-menu-icon.open-nav-menu .top-bar {
        top: 18px;
        width: 0%;
        left: 50%;
    }

    .nav-menu-icon.open-nav-menu .middle-bar-1 {
        transform: rotate(45deg);
    }

    .nav-menu-icon.open-nav-menu .middle-bar-2 {
        transform: rotate(-45deg);
    }

    .nav-menu-icon.open-nav-menu .bottom-bar {
        top: 18px;
        width: 0%;
        left: 50%;
    }
}

/* ##################### NAVBAR END ##################### */

/* ##################### FOOTER START ##################### */

.footer-color {
    background-color: #6d6e71 !important;
}

/* .footer-link {
  box-shadow: 0 0.3rem 0.4rem rgba(0, 0, 0, 0.4);
} */

.footer-link:hover {
    background-color: #e0e0e0 !important;
    /* background-color: red !important; */
    cursor: pointer;
}

.footer-link:hover a {
    color: #000000 !important;
    /* color: white !important; */
}

/* ##################### FOOTER END ##################### */

/* ##################### HOME PAGE BANNER START ##################### */

.home-banner {
    position: relative;
    background-attachment: scroll;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    z-index: 1;
}

.home-banner .home-banner-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: url("//db.cs.cmu.edu/wordpress/wp-content/themes/cmudb/assets/images/banner-overlay.png") 0 0 repeat;
    box-shadow: inset 0 0 128px 0 rgba(0, 0, 0, 1);
    z-index: 2;
}

.home-banner-info-overlay {
    z-index: 3;
}
.home-banner-caption {
    background: #1a1a1add;
}

.home-banner-name {
/*     opacity: 0.9; */
    font-size: 3.6rem;
    background: #c41230dd;
}

@media (max-width: 768px) {
    .home-banner-name {
        font-size: 2.6rem;
    }
}

@media (max-width: 522px) {
    .home-banner-name {
        font-size: 2rem;
    }
}

@media (max-width: 414px) {
    .home-banner-name {
        font-size: 1.7rem;
    }
}

@media (max-width: 360px) {
    .home-banner-name {
        font-size: 1.3rem;
        padding: 0.4rem !important;
    }
}

/* ##################### HOME PAGE BANNER END ##################### */

/* ##################### OTHER PAGEs BANNER START ##################### */

.page-banner {
    position: relative;
    background-attachment: scroll;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    /* filter: brightness(120%); */
    z-index: 1;
}

.page-banner .page-banner-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: url("//db.cs.cmu.edu/wordpress/wp-content/themes/cmudb/assets/images/banner-overlay.png") 0 0 repeat;
    box-shadow: inset 0 0 128px 0 rgba(0, 0, 0, 1);
    z-index: 2;
}

.page-banner-name {
    position: relative;
    top: -2rem;
    left: 0;
    z-index: 4;
    background: #c41230;
    font-size: 3rem;
}

@media (max-width: 768px) {
    .page-banner-name {
        top: -1.5rem;
        font-size: 2.5rem;
    }
}

@media (max-width: 562px) {
    .page-banner-name {
        font-size: 2rem;
    }
}

@media (max-width: 352px) {
    .page-banner-name {
        font-size: 1.3rem;
        padding: 0.3rem !important;
    }
}

/* ##################### OTHER PAGEs BANNER END ##################### */

/* ##################### PROJECTS START ##################### */
.project-image {
    background: #c41230;
    max-width: 180px;
}

.project-image-triangle {
    border-left: 0.5rem solid transparent;
    border-right: 0.5rem solid transparent;
    border-top: 0.5rem solid #c41230;
    margin: auto;
}

.completed-projects-list li {
    border: 1px solid #dee2e6;
    background-color: ghostwhite;
    transition: background-color 0.25s;
    transition: transform 0.25s;
}

.completed-projects-list li:hover {
    background-color: #e0e0e0;
    color: #c41230 !important;
    transform: scale(102%);
    cursor: pointer;
}

.completed-projects-list li:active {
    background-color: #c41230;
    color: #e0e0e0 !important;
}

.project-card {
    transition: transform 0.35s;
    max-width: 15rem;
}

.project-card:hover {
    transform: scale(105%);
}

.project-card {
    line-height: 1.2rem;
}

/* ##################### PROJECTS END ##################### */

/* ##################### PUBLICATIONS START ##################### */

.bib-btn {
    background: #c41230 !important;
}

.bibtex {
    background-color: #e0e0e0;
    border-left: 3px solid #c41230;
    font-family: monospace;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
}

#accordianCollapseAll:hover .rotate-icon-down {
    transform: rotate(-90deg) translateX(-0.1em) translateY(0.5em);
    transition: transform 0.3s ease;
}

#accordianCollapseAll:hover .rotate-icon-up {
    transform: rotate(90deg) translateX(-0.1em) translateY(-0.5em);
    transition: transform 0.3s ease;
}

/* ##################### PUBLICATIONS END ##################### */

/* ##################### NEWS START ##################### */
.page-link {
    border: none;
    background-color: transparent;
    color: #6d6e71;
    font-weight: bold;
    padding: 10px 15px;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-link:hover {
    background-color: transparent;
    color: #c41230;
}

h5.card-title {
  font-weight: 600;
}

.page-link.active {
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    color: black;
    width: 30px;
    height: 30px;
    margin-left: 0.5em;
    margin-right: 0.5em;
}

/* Buttons */
.next-page-btn-large {
    background-color: #6d6e71;
    color: #e0e0e0;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.next-page-btn-large:hover {
    background-color: #c41230;
    color: #e0e0e0;
}

.next-page-btn-large .bi {
    transition: transform 0.3s ease;
}

.next-page-btn-large:hover .bi {
    transform: translateX(8px);
}

.prev-page-btn-large {
    background-color: #6d6e71;
    color: #e0e0e0;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.prev-page-btn-large:hover {
    background-color: #c41230;
    color: #e0e0e0;
}

.prev-page-btn-large .bi {
    transition: transform 0.3s ease;
}

.prev-page-btn-large:hover .bi {
    transform: translateX(-8px);
}

.post-image {
    max-width: 18rem;
}

@media (max-width: 768px) {
  .post-image {
    max-width: 14rem;
  }
}

/* ##################### NEWS END ##################### */

/* ##################### STAFF - FACULTY START ##################### */

@media (max-width: 385px) {
    .flex-xs-wrap-people-card {
        align-items: center !important;
        align-content: center !important;
        padding: 0px !important;
        flex-direction: column !important;
    }

    .flex-xs-wrap-people-card .col-4,
    .flex-xs-wrap-people-card .col-8 {
        flex: 0 0 100% !important;
        width: 100% !important;
        justify-content: center !important;
    }

    .flex-xs-wrap-people-card .card-body {
        text-align: center;
    }
}

/* ##################### STAFF - FACULTY END ##################### */

/* ##################### COURSES START ##################### */

.sem-link:hover {
    background-color: #6d6e71 !important;
    /* color: #E0E0E0 !important; */
}

.sem-link-alt:hover {
    background-color: #c41230 !important;
    /* color: #E0E0E0 !important; */
}

/* ##################### COURSES END ##################### */

/* ##################### SEARCH START ##################### */

.search-card-hover {
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* ##################### SEARCH END ##################### */

/* ##################### EVENT START ##################### */
.event-cancelled {
    background: #6d6e71;
    color: #e0e0e0;
    padding: 0.1rem 0.5rem;
    border-radius: 0.5rem;
}
/* ##################### EVENT END ##################### */
