/* General Stuff*/

html {
    background-color: #333642;
}

* {
    margin: 0;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;

    /*Text specific stuff*/
    letter-spacing: 0.4px;
    font-size: 15px;
    font-family: "latobold";
    color: #D0D4E1;
}

.align {
    display: flex;
    align-items: center;
    justify-content: center;
}

/*! Tutorial mini-box*/ 

.tutorial {
    position: absolute;
    z-index: 1000000;
    pointer-events: none;
}

.tutorial object {
    width: 10px;
    position: relative;
    top: 10px;
    left: 25px;
}

.tutorial p {
    padding: 5px 10px;
    background-color: #17866A;
    width: max-content;
    font-family: 'latoregular';
    border-radius: 5px;
    box-shadow: 0px 0 30px rgba(0, 0, 0, 0.15);
    
}

/** Nav*/

nav {
    width: auto;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.question_btn {
    margin-top: 5px;
    align-items: center;
    display: flex;
    padding: 5px;
    height: fit-content;

    transition: all 0.5s;
}

.question_btn:hover {
    background-color: #3C3F4C;
    border-radius: 5px;
}

#nav-tut {
    /* Initially hidden and fully transparent */
    visibility: hidden;
    opacity: 0;

    /* Apply a transition for the fade effect */
    transition: opacity 0.3s ease, visibility 0.3s linear;
}

/* Class to show the tutorial box */
#nav-tut.visible {
    visibility: visible;
    opacity: 1;
}

.plus_btn {
    margin-top: 5px;
    margin-left: 5px;
    align-items: center;
    display: flex;
    padding: 5px;
    height: fit-content;

    transition: all 0.5s;
}

.plus_btn:hover {
    background-color: #3C3F4C;
    border-radius: 5px;
}

.tab {
    cursor: pointer;

    margin-left: 10px;
    margin-top: 12px;    
    height: 60px;
    width: 210px;
    background-image: url('HtmlElements/tab_selected.svg'); /* Path to your SVG file */
    background-repeat: no-repeat; /* Don't repeat the SVG */
    background-position: center;  /* Center the SVG */
    background-size: 100%;         /* Scale the SVG to 50% of the div's size */

    /*Content Styling*/
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-family: "latobold";
}

#LoginButton {
    display: none;
    cursor: pointer;
    text-decoration: none;
    background-color: #3b3f4c;
    border: none;
    font-family: 'latobold';
    font-size: 15px;
    border-radius: 5px;
    padding: 6px 17px;
    color: #D0D4E1;
    transition: all 0.5s;
}

#LoginButton:hover {
    background-color: #484c5c;
}

.propic{
    width: 35px;
    height: 35px;
    border-radius: 100%;
    margin-left: 10px;
    border: 1.5px solid white;
}

/*! Login PopUP*/

#AccountSettingsPopUp {
    opacity: 0;
    visibility:hidden;
    transition: opacity 0.3s ease;
    will-change: opacity; /* Hint to browser to optimize transition */
    position: fixed;
    right: 340px;
    top: 75px;
    z-index: 5000;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

#AccountSettingsPopUp.visible {
    opacity: 1;
    visibility: visible;
}

/* Background overlay to close the popup when clicked outside */
#AccountSettingsPopUp.visible .AccountSettingsBackground {
    pointer-events: auto;
}

.AccountSettingsBackground {
    position: absolute;
    z-index: 1000; /* High z-index to ensure it's on top; removed duplicate */
    width: 270px;
    background-color: #333642;
    border: 2px solid #9ca2b6;
    border-radius: 5px;
    box-shadow: 0px 0 30px rgba(0, 0, 0, 0.15);
    padding: 30px 25px; /* Removed duplicate padding */
    position: absolute;
}

#closeAccountPopup {
    transition: all 0.5s;
    position: absolute;
    right: 20px;
    top: 30px;
    padding: 0;
    height: 25px;
    width: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}
#closeAccountPopup:hover {
    background-color: #3C3F4C;
}

#AccountSettingsPopUp p {
    font-family: 'latoregular';
    margin-right: 10px;
    font-size: 15px;
}

#AccountSettingsPopUp input.textfield {
    width: 100%;
    font-size: 13px;
    height: 20px;
    border-radius: 5px;
    background-color: #3C3F4C;
    border: 1px solid #8E9199;
    color: #D0D4E1;
    outline: none;
    padding-left: 5px;
    font-family: 'latobold';
}

#AccountSettingsPopUp input.textfield:focus {
    border: 1px solid #b9bfd3;
    background-color: #454958;
}

button#changeAccountName {
    margin-left: 5px;
    height: 25px;
    background-color: #484b59;
    border: 1px solid #ACB5D0;
    color: #ACB5D0;
    font-family: 'latobold';
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}
button#changeAccountName:hover {
    background-color: #575b6c;
    border: 1px solid #c6cee9;
    color: #c6cee9;
}

button#changeProfilePicture {
    background: none;
    border: none;
    font-family: 'latobold';
    color: #8B93AA;
    text-decoration: underline;
    font-size: 12px;
    cursor: pointer;
    margin-left: 5px;
}
button#changeProfilePicture:hover {
    color: #acb5d0;
    transition: all 0.2s;
}

img#propicPOP {
    width: 25px;
    height: 25px;
    border: 1px solid #FFFFFF;
}

button#SignOutButton {
    margin-top: 25px;
    background-color: #423C47;
    border: 1px solid #E49C9C;
    color: #FF9277;
    font-family: 'latobold';
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
}
button#SignOutButton:hover {
    border: 1px solid #f6aeae;
    color: #ffac97;
    background-color: #57484d;
}

.tpos2 {
    position: absolute;
    right: -295px;
    top: -50px;
    z-index: -30;
}

/** Main */

main {
    height: calc(100vh - 50px);
    width: 100%;
    background-color: #45404F;
    border-top: #707586 1.5px solid;
}

main .menu {
    display: flex;
    align-items: center;
    padding: 15px;
}

.class_settings_btn {
    font-size: 12px;
    font-family: "latoregular";
    padding: 9px 15px;
    border: 1.5px solid #707586;
    border-radius: 6px;
    margin-right: 10px;

    transition: all 0.5s;
}

.class_settings_btn:hover {
    background-color: #544F5E;
    cursor: pointer;
}

main .menu img {
    height: 30px;
    margin-left: 5px;
}

.invite_people_btn {
    margin-left: 15px;
    font-size: 12px;
    font-family: "latoregular";
    padding: 9px 15px;
    border: 1.5px solid #51A68E;
    color: #9CE4CF;
    border-radius: 6px;
    margin-right: 10px;

    transition: all 0.5s;
}

.invite_people_btn:hover {
    background-color: #4f5e5153;
    cursor: pointer;
}

/*! Class settings POPUP */

#ClassSettingsPopUp {
    opacity: 0;
    visibility:hidden;
    transition: opacity 0.3s ease;
    will-change: opacity; /* Hint to browser to optimize transition */
    position: fixed;
    left: 17px;
    top: 123px;
    z-index: 5000;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

#ClassSettingsPopUp.visible {
    opacity: 1;
    visibility: visible;
}

/* Background overlay to close the popup when clicked outside */
#ClassSettingsPopUp.visible .AccountSettingsBackground {
    pointer-events: auto;
}

.ClassSettingsBackground {
    position: absolute;
    z-index: 1000; /* High z-index to ensure it's on top; removed duplicate */
    width: 270px;
    background-color: #333642;
    border: 2px solid #9ca2b6;
    border-radius: 5px;
    box-shadow: 0px 0 30px rgba(0, 0, 0, 0.15);
    padding: 30px 25px; /* Removed duplicate padding */
    position: absolute;
}

.ClassSettingsBackground input.textfield {
    width: 100%;
    font-size: 13px;
    height: 20px;
    border-radius: 5px;
    background-color: #3C3F4C;
    border: 1px solid #8E9199;
    transition: all 0.5s;
    color: #D0D4E1;
    outline: none;
    padding-left: 5px;
    font-family: 'latobold';
}

.ClassSettingsBackground input.textfield:focus {
    border: 1px solid #b9bfd3;
    background-color: #454958;
}

#closeClassSettingsPopup {
    position: absolute;
    right: 20px;
    top: 30px;
    padding: 0;
    height: 25px;
    width: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.5s;
}
#closeClassSettingsPopup:hover {
    background-color: #3C3F4C;
}

#ClassSettingsPopUp p {
    font-family: 'latoregular';
    margin-right: 10px;
    font-size: 15px;
}

button#changeClassName {
    margin-left: 5px;
    height: 25px;
    background-color: #484b59;
    border: 1px solid #ACB5D0;
    color: #ACB5D0;
    font-family: 'latobold';
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

button#changeClassName:hover {
    background-color: #575b6c;
    border: 1px solid #c6cee9;
    color: #c6cee9;
}

#classCode {
    background-color: #666B7A;
    color: #9CE4CF;
    font-weight: bold;
    height: 24px;
    width: 100%;
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding-left: 5px;
}

.tpos3 {
    position: absolute;
    left: 43px;
    top: -50px;
    z-index: -30;
}

#classSettings_tut {
    /* Initially hidden and fully transparent */
    visibility: hidden;
    opacity: 0;

    /* Apply a transition for the fade effect */
    transition: opacity 0.3s ease, visibility 0.3s linear;
}

/* Class to show the tutorial box */
#classSettings_tut.visible {
    visibility: visible;
    opacity: 1;
}

#LeaveClassBTN {
    margin-top: 25px;
    background-color: #423C47;
    border: 1px solid #E49C9C;
    color: #FF9277;
    font-family: 'latobold';
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

#LeaveClassBTN:hover {
    border: 1px solid #f6aeae;
    color: #ffac97;
    background-color: #57484d;
}

/* File Share*/

.file_share {
    flex: 3;                  /* takes about 3/4 of width */
    min-width: 300px;         /* keeps it usable at small screens */
    background-color: #544F5E;
    margin-left: 15px;
    margin-right: 15px;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
    padding-bottom: 20px;
    contain: layout; /* Optimize rendering */
}

.file_share .top {
    display: flex;
    align-items: center;
    padding: 20px;
    
}

.plus_btn_2 {
    background-color: #2A3042;
    height: 60px;
    width: 60px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;

    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);

    transition: all 0.5s;
}

.plus_btn_2:hover {
    background-color: #2c3347;
}

/*! FILES POPUP */

#filesPopup {
    opacity: 0;
    visibility: hidden; /* Use visibility instead of display: none */
    z-index: 1000; /* Increase z-index to ensure it’s above other elements */
    position: absolute;
    top: 145px;
    left: 30px;
    transition: opacity 0.3s ease;
    will-change: opacity; /* Hint to browser to optimize transition */
}

#filesPopup.visible {
    opacity: 1;
    visibility: visible;
}

.Background {
    background-color: #333642;
    position: absolute;
    height: 300px;
    width: 550px;
    border-radius: 5px;
    z-index: 10;
    padding: 10px;
    border: 2px solid #9ca2b6;
    box-shadow: 0px 0 30px rgba(0, 0, 0, 0.15);
}

/* Ensure child elements don’t interfere */
#filesPopup .close-tab {
    cursor: pointer;
    margin-left: 10px;
    margin-top: 12px;
    height: 60px;
    width: 85px;
    background-image: url('HtmlElements/closetab1.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: "latobold";
    position: relative;
    bottom: -15.5px;
    right: -450px;
}

.chooseFiles {
    background-color: #D9D9D9;
    padding: 20px 25px;
    border: none;
    cursor: pointer;
    font-family: "latoregular";
    box-shadow: 0px 0 15px rgba(0, 0, 0, 0.15);
    margin-top: 25px;
    border-radius: 6px;
    font-size: 15px;
    color: #333642;
}

#filesPopup input.link{
    background-color: #3C3F4C;
    color: #A8AFC2;
    border: 2px solid #8E9199;
    margin-top: 25px;
    border-radius: 5px;
    height: 35px;
    width: 250px;
    font-family: "latoregular";
    font-size: 15px;
    outline: none;
    padding-left: 10px;
    transition: all 0.5s;
}

#filesPopup input.link:focus {
    border: 2px solid #b9bfd3;
    background-color: #454958;
}

#filesPopup .Next {
    margin-top: 25px;
    background-color: #D9D9D9;
    box-shadow: 0px 0 15px rgba(0, 0, 0, 0.15);
    font-family: "latoregular";
    border-radius: 6px;
    font-size: 15px;
    color: #333642;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
}


.triangle, .triangle:before, .triangle:after {
  width: 20px; /* Reduced to 10px */
  height: 20px; /* Reduced to 10px */
  
}

.triangle {
  overflow: hidden;
  margin: 2em auto 0; /* Adjusted margin for smaller size */
  border-radius: 15% 15% 0 0; /* Round only the top tip */
  transform: translateY(50%) rotate(30deg) skewY(30deg) scaleX(.866);
  border: 2px solid #9ca2b6;
  z-index: 0;
}

.tpos1 {
  position: absolute;
  left: 23px; /* Move left by 50px; adjust as needed */
  bottom: -77px;
}

.triangle:before, .triangle:after {
  position: absolute;
  background: #383b48;
  pointer-events: auto;
  content: '';
}


.triangle:before {
  border-radius: 15% 15% 0 0; /* Round only the top tip */
  transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(-42.3%) 
          skewX(30deg) scaleY(.866) translateX(-24%);
}

.triangle:after {
  border-radius: 15% 15% 0 0; /* Round only the top tip */
  transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(-42.3%) 
          skewX(-30deg) scaleY(.866) translateX(24%);
}

/*Conts*/

.main_conts {
    padding: 10px 0;
    margin: 0 20px 0 0;
}

.notes_cont {
    /*background-color: rgba(255, 0, 0, 0.102);*/
    width: 350px;
    height: 400px;
    
}

.slides_cont {
    background-color: rgba(0, 128, 0, 0.095);
    width: 200px;
    height: 400px;
    
}

.o_materials_cont {
    background-color: rgba(0, 0, 255, 0.091);
    width: 200px;
    height: 400px;
    
}

.file_share .title_containers {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-top: 20px;
}

.file_share .title_containers p{
    margin-left: 8px;
}

/*Notes Chips*/

/* (Converted to Grid) */
#containernoteschips {
    display: grid;
    grid-template-columns: repeat(2, 150px); /* Two fixed 150px columns */
    grid-auto-rows: 180px; /* Fixed row height */
    gap: 10px;
    justify-content: start;
    contain: layout;
}

.template-div {
    width: 150px; /* Fixed size */
    height: 180px; /* Fixed size */
    display: flex;
    flex-direction: column; /* Stack title and text vertically */
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-sizing: border-box;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
    cursor:pointer;
}

.template-div .editable-text {
    min-height: 50px;
    border: 1px dashed #ddd;
    padding: 10px;
    outline: none;
    overflow: auto;
}

.template-div img {
    width: 100%;
    height: 45%; /* Occupies 45% of the parent .template-div's height (e.g., 81px if div is 180px) */
    object-fit: cover; /* Crops the image to fill the space without stretching */
    object-position: center top; /* Optional: Crops from the top-center; adjust as needed (e.g., center center) */
    border-top-left-radius: 3px; /* Top-left corner radius */
    border-top-right-radius: 3px; /* Top-right corner radius */
}

.template-div div {
    display: flex;
    justify-content: center;
    align-items: center;
}

.template-div h3 {
    margin-top: 11%;
    font-size: 15px;
    text-align: center;
}

.template-div .icon {
    width: 20px;
    height: auto;
    margin-bottom: 15%;
    object-fit:contain; /* Crops the image to fill the space without stretching */
    object-position: center top; /* Optional: Crops from the top-center; adjust as needed (e.g., center center) */
}


/* Chat */

.chat {
    flex: 1;  /* takes about 1/4 of width */
    min-width: 200px;
    background-color: #544F5E;
    margin-right: 15px;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
    padding-bottom: 20px;
}


/** Media Queries */


/* Responsive adjustments */
@media (max-width: 1200px) {
    .file_share {
        flex: 2;
        min-width: 250px;
    }
    .chat {
        min-width: 200px;
    }
    .file_share .title_containers {
        grid-template-columns: 1fr; /* Stack on smaller screens */
    }
}

@media (min-width: 1300px) {
    .file_share {
        flex: 3;
        max-width: 1000px;
    }
    .chat {
        max-width: 350px;
    }
}