/* ------------------- */
/* Reset               */
/* ------------------- */

/* Box sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Reset margins */
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
    margin: 0; 
}

/* set up the body */
body {
    line-height: 1.5;
    min-height: 100vh;
}

/* make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}

/* make form elements easier to work with */
input,
button,
textarea,
select {
    font: inherit;
}

/* remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------- */
/* Styles              */
/* ------------------- */

body {
    background-color: black;
    color: white;
    font-family: sans-serif;
}

/* ------------------- */
/* Utility             */
/* ------------------- */

.hide {
    display: none;
}

.circle {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: #FFC107;
}

/* ------------------- */
/* Structure           */
/* ------------------- */

main {
    display: flex;
}

.content {
    flex: 3;
    padding: 1rem;
    padding-top: calc(1rem + 3rem + 1rem + .5rem);
}

/* .content .box {
    height: 80vh;
    border: red 2px solid;
} */

.navbar {
    max-width: 15rem;
    position: sticky;
    top: 0;
    left: 0;
    height: 100vh;
    padding: 1rem;
    background-color: black;
    /* display: flex;
    flex-direction: column;
    align-items: center; */
}

/* .navbar * {
    border: .5px solid lime;
} */

.navbar img {
    width: 3rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.6rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding-block: 1.5rem;
    z-index: 10;
}

.sidebar .tab {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: white;
    text-decoration: none;
    /* border: 1px solid white; */
    border-radius: .5rem;
    padding: .5rem;
    /* margin-block: .5rem; */
}

.sidebar .tab.active {
    border: 1px solid white;
    background-color: #1A1A1A;
}

#hamburger-menu {
    display: none;
}

/* ------------------- */
/* Home page           */
/* ------------------- */

body.home .content {
    padding: 1rem;
    padding-top: calc(1rem + 3rem + 1rem + .5rem);

    display: grid;
    gap: 1rem;

    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: max-content max-content max-content;

    /* max-width: 50vw;
    margin-inline: auto; */
}

/* Defining grid areas */
body.home .content .user-count-display {
    grid-column: 3 / -1;
    grid-row: 1 / 2;
}

body.home .content .chart-container {
    grid-column: 3 / -1;
    grid-row: 2 / 3;
    place-self: center;
}

body.home .content .insights-display {
    grid-column: 1 / -1;
}

body.home .content .application-state-display {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}
/* END Defining grid areas */

body.home .content .user-count-display {
    border: 1px solid white;
    border-radius: .5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    
}

/* body.home .content .chart-container {
    max-width: 30rem;
} */

body.home .content .application-state-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid white;
    border-radius: .5rem;
    padding: 1rem;
}

body.home .content .application-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.home .content .application-state > div {
    display: flex;
    align-items: center;
    gap: .5rem;
}

body.home .content .registration-requests-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.home .content .registration-requests-container {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    max-height: 15rem;
    overflow: auto;
}

body.home .content .registration-requests-container .request {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.home .content .registration-requests-container .request div:last-of-type {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.accept-request-btn {
    background-color: #00FF37;
}

.decline-request-btn {
    background-color: #FC4850;
}

body.home .content .insights-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid white;
    border-radius: .5rem;
    padding: 1rem;
}

body.home .content .insights-display .insights-container {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

body.home .content .insights-display .insights-container .insight div.circle {
    float: left;
    margin-right: .5rem;
}

/* ------------------- */
/* Users page          */
/* ------------------- */

/* (Some settings are applicable to the notifications and support pages) */

body .content .controls {
    display: flex;
    align-items: start;
    justify-content: space-between;

    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    padding-block: 1rem;
    background-color: black;
}

body .content .controls input,
body .content .controls button,
body .content .controls .communication-navigation-btn {
    border: 1px solid white;
    background-color: #222222;
    border-radius: .5rem;
    color: white;
    padding: .2rem .4rem;

    text-decoration: none;
}

body .content .controls > div {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.create-user-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.create-user-btn img {
    width: 1.5rem;
}

body.users .content .users-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1rem;
}

body.users .content .users-container .user {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    border: 1px solid white;
    border-radius: .5rem;
    padding: 1rem;
    text-decoration: none;
    color: white;

    transition: background-color 200ms ease-in-out;
}

body.users .content .users-container .user:hover {
    background-color: #222222;
}

body.users .content .users-container .user p:last-of-type {
    display: flex;
    gap: 1rem;
}

body.users .content .users-container .user .user-email-status,
body.users .content .users-container .user .user-account-status {
    color: #FC4850;
}

body.users .content .users-container .user .user-email-status.active,
body.users .content .users-container .user .user-account-status.active {
    color: #00FF37;
}

body.users .add-user-modal-wrapper {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

body.users .add-user-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    padding: 1rem;
    background-color: #1A1A1A;
    border: 1px solid white;
    border-radius: .5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.users .add-user-modal input,
body.users .add-user-modal button {
    border-radius: .5rem;
    background-color: #1A1A1A;
    color: white;
    border: 1px solid white;
    padding: .2rem .4rem;
}

body.users .add-user-modal p {
    margin-bottom: .5rem;
}

body.users .add-user-modal button.active {
    border: 3px solid white;
}

body.users .add-user-modal img {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.5rem;
}

/* ------------------- */
/* User page           */
/* ------------------- */

body.user .content .grid-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 1rem;
}

body.user .content .grid-wrapper > div {
    padding: 1rem;
    border: 1px solid white;
    border-radius: .5rem;

    grid-row: span 2;
}

body.user .content .grid-wrapper > div button {
    padding: .2rem .4rem;
    border: none;
    background-color: black;
    color: white;
}

body.user .content .grid-wrapper .username-display,
body.user .content .grid-wrapper .userID-display
 {
    grid-row: span 1;
}


body.user .content .grid-wrapper .account-state-display,
body.user .content .grid-wrapper .user-email-display {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: .5rem;
}

body.user .content .grid-wrapper .user-email-display > p,
body.user .content .grid-wrapper .account-state-display > p {
    display: flex;
    justify-content: space-between;
}

body.user .content .grid-wrapper .common-editable,
body.user .content .grid-wrapper .common-selectable {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.user .content .grid-wrapper .common-selectable > div {
    display: flex;
    gap: .5rem;
}

body.user .content .grid-wrapper .common-selectable > div > div.approve {
    background-color: #00FF37;
}

body.user .content .grid-wrapper .common-selectable > div > div.disapprove {
    background-color: #FC4850;
}

/* ------------------------------------ */
/* Communication Notification & Support */
/* ------------------------------------ */

body.communication .content .notifications-container,
body.communication .content .tickets-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.communication .content .notifications-container .notification,
body.communication .content .tickets-container .ticket {
    display: flex;
    align-content: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 1rem;
    border: 1px solid white;
    border-radius: .5rem;
}

body.communication .content .notifications-container .notification button,
body.communication .content .tickets-container .ticket button {
    border: none;
    background-color: black;
    color: white;
}

body.communication .content .notifications-container .notification button {
    color: #FC4850;
}

body.communication .content .notifications-container .notification > div > div {
    display: flex;
    align-items: center;
    gap: .5rem;
}
body.communication .content .notifications-container .notification > div > div img {
    width: 1.5rem;
}

body.communication .content .notifications-container .notification > div > div > p {
    display: flex;
    gap: .5rem;
}

/* ------------------- */
/* App settings        */
/* ------------------- */

body.app-settings .content .grid-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

body.app-settings .content .grid-wrapper .application-state-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;grid-column: span 3;
    
}

body.app-settings .content .grid-wrapper .application-state-display > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

body.app-settings .content .grid-wrapper .state-setting {
    padding: 1rem;
    border: 1px solid white;
    border-radius: .5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.app-settings .content .grid-wrapper .state-setting > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

/* ------------------- */
/* Login               */
/* ------------------- */

body.login {
    display: grid;
    place-content: center;
}

body.login main {
    display: flex;
    flex-direction: column;
    gap: .5rem;

    width: 90vw;
    max-width: 350px;
}

body.login input {
    background-color: black;
    color: white;
    border: 1px solid #222222;
}

body.login button {
    background-color: black;
    color: white;
    border: 2px solid white;
    transition: all 200ms ease-in-out;
    margin-top: 1rem;
}

body.login button:hover {
    background-color: white;
    color: black;
    /* border: 2px solid black; */
}

/* Splitting the grid on mobile for the home page */
@media (max-width: 660px) {
    body.home .content,
    body.user .content .grid-wrapper {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 60rem) {

    /* ------------------- */
    /* Structure mobile    */
    /* ------------------- */

    .content {
        padding: 1rem !important;
    }
    
    #hamburger-menu {
        display: block;
        position: fixed;
        top: 1rem;
        right: 1rem;
    }

    .sidebar {
        position: fixed;
        top: calc(1rem + 3rem + 1rem); /* the nav's padding - offsetheight - padding */
        bottom: 0;
        right: 0;
        width: 80vw;
        max-width: 25rem;
        padding: 1rem;
        z-index: 10;
        background-color: rgba(0, 0, 0, 0.8);

        translate: 100% 0;
        transition: translate 200ms ease-in-out;
    }

    .sidebar.active {
        translate: 0 0;
    }

    .navbar {
        max-width: unset;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        height: unset;
    }

    body {
        display: unset;
    }

    main {
        flex-direction: column;
    }

    /* ------------------- */
    /* Home page mobile    */
    /* ------------------- */
    /* there's nothing here - to be deleted */

    /* ------------------- */
    /* Users page mobile   */
    /* ------------------- */

    .create-user-btn p {
        display: none;
    }

    /* -------------------------- */
    /* Communication Notification */
    /* -------------------------- */

    body.communication .page-title p {
        font-size: .8rem;
    }
}

/* Removing the search button on notifications and support pages on mobile */
@media (max-width: 660px) {
    body.communication .controls .search-btn,
    body.communication .controls .send-btn {
        display: none;
    }
}

/* Reducing the grid to 2 columns for mobile on the users page */
@media (max-width: 660px) {
    body.users .content .users-container {
        grid-template-columns: repeat(2, 1fr);
        font-size: .8rem;
    }
}

/* Splitting the grid on mobile for the app settings page */
@media (max-width: 660px) {
    body.app-settings .content .grid-wrapper {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}