body,
html {
    width: 100vw;
    height: 100%;
    overflow: hidden;
}

body {
    padding: 20px 30px 5px;
    display: flex;
    flex-direction: column;
}

.main-container {
    position: relative;
    gap: 20px;
    padding: 8px;
    flex-grow: 1;
}

i {
    font-size: var(--icon-font-size);
}

.logo {
    width: 65px;
    height: 62px;
    background-image: url(../static/logo-black.svg);
    background-repeat: no-repeat;
    background-position: center;
}

.fullscreen .logo {
    background-image: url(../static/logo-white.svg);
}

.fullscreen .logo + div * {
    color: white;
}

.content {
    transition: width 0.3s ease-in-out;
}

.controls {
    border-radius: 12px;
    background-color: var(--mit-gray-700);
    padding: 12px;

}

.controls .btn.active {
    background-color: var(--mit-primary-600);
    color: white;
}

.controls .left {
    align-items: center;
    color: white;
}

.controls .center #btn-disconnect {
    background-color: var(--surface-error-surface-secondary);
    color: var(--surface-surface-bg);
}

.controls .center button.active {
    background-color: var(--mit-primary-300);
    color: white;
}

button {
    padding: 10px;
}

.videos-container {
    height: calc(100vh - 155px);
    /*padding: 20px 0;*/
    overflow: hidden;

    display: flex;
    flex-direction: column;
    position: relative;

}

.videos-container .remote-videos {
    display: flex;
    flex: 1 1 auto;
    align-content: center;
    width: 100%;

    /*height: 78%;*/
    overflow: auto;

    /*background-color: blue;*/
}

.videos-container .local-video {
    padding-top: 10px;
    /*background-color: purple;*/
    display: flex;
    align-content: center;
}

.videos-container .local-video .secondary-grid {
    display: flex;
    flex: 1;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow: auto;
    gap: 5px;
    min-width: 100px;
    /*max-width: 80%;*/
    /*background-color: yellow;*/
    align-items: center;
}

.videos-container .local-video .secondary-grid .video-tile {
    height: 170px;
    width: 300px;
    flex: 0 0 auto;
}

.videos-container .local-video #local-video-div {
    float: right;
    width: 300px;
    /*Height is set using 16/9 ratio*/
    height: 168.75px;
}

#local-video-div.pinned {
    position: absolute;
    right: 20px;
    border: 1px solid white;
}

.videos-container .remote-videos .inner-remote-videos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.videos-container .remote-videos .video-tile {
    flex: 1 1 300px;
    display: flex;
    position: relative;
    min-height: 150px;
    min-width: 300px;
    max-height: max(800px, 100%);
    /*max-width: min(60%, 1323px);*/
}

.video-tile {
    display: flex;
    position: relative;
    border-radius: 12px;
    background-color: var(--mit-gray-900);
}

.video-tile.user-placeholder .user-video-id {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.5);
    /* optional: adds a slight background to make text readable */
    padding: 15%;
    border-radius: 50%;
    bottom: auto;
}

video {
    height: 100%;
    width: 100%;
    object-fit: contain;
    aspect-ratio: 16/9;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
}

/* SIDEBAR STYLES */
/* SIDE BAR */
.aside-right {
    inset: 0 0 0 auto;
    position: absolute;
    right: -400px;
    transition: right 0.3s ease-in-out;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    background-color: var(--surface-surface-bg);
    width: calc(var(--side-bar-width) - 20px);
    border: 1px solid var(--surface-surface-quaternary);
    margin: 8px 0;
    z-index: 9999;

}

.aside-right.open {
    right: 0;
    transition: right 0.3s ease-in-out;
}

aside>* {
    display: none;
}

aside>div.open {
    display: block;
}

/*CHAT SECTION*/
#chat-section.open {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    ;
}

a:hover {
    text-decoration: none;
}

a:hover span {
    text-decoration: underline;
}

#chat-section #chat-box {
    flex-grow: 1;
    overflow-y: auto;
}

#chat-section .chatInput {
    margin: 1rem auto 0;
    width: 95%;
}

#chat-section .chatBox .chat-message .chat-date {
    font-size: 12px;
    color: var(--text-body, #656565);
}

.chat-message .remote,
.chat-message .local {
    width: fit-content;
    min-width: 50%;
    max-width: 90%;
    padding: 10px;
    border-radius: 10px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.chat-message .local {
    background: var(--mit-primary-50);
    margin: 5px 0 5px 15px;
    border-top-left-radius: 0 !important;
}

.chat-message .chat-text {
    margin: 5px 0 0;
}

.chat-message .local::before {
    position: absolute;
    content: "";
    top: 0;
    left: -12px;
    border-top: 5px solid var(--mit-primary-50);
    border-right: 10px solid var(--mit-primary-50);
    border-bottom: 10px solid transparent;
    border-left: 5px solid transparent;
}

.chat-message:has(.remote) {
    flex-direction: row-reverse;
}

.chat-message .remote {
    background: var(--mit-success-50);
    margin: 5px 15px 5px 0;
    border-top-right-radius: 0 !important;
}

.chat-message .remote::before {
    position: absolute;
    content: "";
    top: 0;
    right: -12px;
    border-top: 5px solid var(--mit-success-50);
    border-right: 5px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid var(--mit-success-50);
}

#msg-count {
    color: white;
    font-size: 11px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    position: absolute;
    left: 100%;
    top: 0;
    width: 20px;
    height: 20px;
    transform: translate(-70%, -25%);
    background-color: var(--mit-error-700);
    border-radius: 50%;
}

#msg-count.hide {
    display: none;
}

.input-section {
    bottom: 0;
}

#file-upload {
    margin-top: 1rem;
    justify-items: center;
    font-size: 12px;
}

.input-group input:focus {
    box-shadow: none;
    outline: none;
}

#chat-input:has(input:focus) {
    box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05), 0 0 0 4px var(--surface-brand-surface-brand-tertiary);
    outline: 1px solid var(--surface-brand-surface-brand-secondary);
}

/* ERROR MOCKUP STYLING */
.mockup {
    display: none;
    /* initially hidden */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--surface-surface-bg);
    border: 1px solid var(--surface-surface-tertiary);
    border-radius: 10px;
    padding: 20px;
    z-index: 1001;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 300px;
    max-width: 90%;
    text-align: center;
}

.mockup h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    /*color: var(--primary-color);*/
}

.mockup p {
    padding-top: 1rem;
}

.mockup label {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
    /*color: var(--text-color);*/
}

.mockup select {
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    /*border: 1px solid var(--border-color);*/
    border-radius: 5px;
    font-size: 1rem;
    /*background-color: var(--background-color);*/
    /*color: var(--text-color);*/
}

.mockup span.close-btn {
    background-color: red;
    color: white;
    padding: 5px;
    cursor: pointer;
    border-radius: 5px;
}

.mockup button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    /*background-color: var(--button-color);*/
    /*color: var(--button-text-color);*/
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.mockup button:hover {
    background-color: var(--button-hover-color);
}

/* END ERROR MOCKUP STYLING */

/* OVERLAY STYLING */
#overlay {
    display: none;
    /* initially hidden */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* END OVERLAY STYLING */

/* CONFIG BUTTON STYLING */
.config-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: var(--surface-brand-surface-brand-primary);
    /*color: var(--button-text-color);*/
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease-in-out;
}

.config-button svg {
    background-image: url(../static/settings-icon-white.svg);
    background-repeat: no-repeat;
    background-position: center;
}

.config-button:hover {
    background-color: var(--button-hover-color);
}

/* END CONFIG BUTTON STYLING */

/* INITIAL MODAL */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    gap: 20px;
    background-color: rgba(0, 0, 0, 1);
    justify-content: center;
    align-items: center;
    align-self: center;
    z-index: 13;
}

.modal-content {
    display: flex;
    flex-direction: row;
    background-color: var(--mit-gray-100);
    padding: 20px;
    border-radius: 16px;
    width: 100%;
    height: 75%;
    max-height: 95%;
    margin: 0 100px;
    justify-content: center;
    align-items: center;
    gap: 10px
}

.modal-content .modal-left {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.modal-content .modal-left #modal-video-div {
    position: relative;
    width: 80%;
    max-height: 80%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
}


.modal-content .modal-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.modal-video-controls {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
}

.modal-video-controls button {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.modal-video-controls button.unactive {
    opacity: 0.7;
}

.modal-video-controls button.active {
    background: #f44336;
    color: #fff;
    opacity: 1;
}

.modal-video-controls button:focus {
    outline: 2px solid #1976d2;
}

/* END INITIAL MODAL */

/* Pin button styling */
.video-tile .pin-btn {
    position: relative;
    background: #00000080;
    color: white;
    border: none;
    /*padding: 8px;*/
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-tile .pin-btn.pinned {
    opacity: 1;
    background: var(--mit-success-300)
}

.video-tile .pin-btn:hover {
    background: white
}

.video-tile .pin-btn:hover i,
.video-tile .pin-btn.pinned i::before {
    color: black;
    content: "\ec58";
}

.video-tile .pin-btn.pinned i:after {
    content: "";
    position: absolute;
    top: 45%;
    left: 20%;
    width: 60%;
    transform: rotate(50deg);
    border-bottom: 2px solid #000000;
    z-index: 99;
}

.video-tile:hover .pin-btn {
    opacity: 1;
}

/* Video tile muted styling  */
.video-tile .mute {
    display: none;
    background: #00000080;
    color: white;
    transition: opacity 0.3s ease;
}

.video-tile .mute.muted {
    display: block;
    margin-top: 0;
}

.video-tile .top-bar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
}

/* user-video-id positioning */
.video-tile .user-video-id {
    display: block;
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0);
    color: #FFFFFF;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
    /* Prevents interference with video interactions */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    /* Improves readability */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Show ellipses for overflow */
    max-width: 70%; /* Adjust as needed, limits the width */
}

/* style notifications */
#notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 320px;

}

.notification {
    background-color: rgba(32, 33, 36, 0.9);
    color: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out forwards;
    position: relative;
    overflow: hidden;
    border: 1px solid white;
}

.notification-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #8AB4F8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
    font-size: 16px;
    color: #202124;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 14px;
}

.notification-message {
    font-size: 13px;
    opacity: 0.9;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: #8AB4F8;
    width: 100%;
    animation: progress 3s linear forwards;
}

/*Invite Modal Styling - Duplicate*/
.meeting-type {
    margin-bottom: 24px;
}

.type-selector {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.type-option {
    flex: 1;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

.type-option.selected {
    border-color: var(--surface-brand-surface-brand-primary);
    background-color: var(--surface-brand-surface-brand-tertiary);
}

/* Add this new style */
.private-meeting .suggestion-item.custom-email {
    display: none;
}

.email-section {
    margin-bottom: 24px;
}

.email-input-container {
    position: relative;
    margin-top: 8px;
}

.email-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.email-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    max-height: 150px;
    overflow-y: auto;
}

.email-chip {
    background: #e8f0fe;
    padding: 4px 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remove-chip {
    cursor: pointer;
    color: #5f6368;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-item.selected {
    background-color: #f1f3f4;
}

.suggestion-item:hover {
    background: #f1f3f4;
}

.suggestion-avatar {
    width: 24px;
    height: 24px;
    background: #1a73e8;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/*mobile media*/
@media (max-width: 435px) {
    :root {
        --side-bar-width: 200px
    }

    ;

    .aligner {
        height: 88%;
    }

    .videos-container .remote-videos {
        align-content: flex-start;
    }

    .videos-container .aligner .remote-videos .video-tile {
        max-width: 85%;
    }

    .videos-container #local-video-div {
        height: 100px;
        width: 200px;
    }

    .modal-content {
        flex-direction: column;
        gap: 20px;
        margin: 10px;
        padding: 10px;
        height: auto;
    }

    /*.aside-right {*/
    /*    position: relative;*/
    /*    float: right;*/
    /*    right: 0;*/
    /*    height: calc(100% - 80px);*/
    /*    width: 300px;*/
    /*}
    */

    .aside-right {
        /*height: calc(100% - 80px);*/
    }

    .aside-right.open {
        position: absolute;
        /*right: - var(--side-bar-width);*/
        width: 300px;
    }

    #user-id {
        display: none;
    }

    #meeting-id {
        display: none;
    }

    /*.videos-container .remote-videos .video-tile { min-width: 300px; }*/
    i {
        font-size: var(--icon-font-size-mobile);
    }

    .controls {
        width: 100%;
    }

    .controls .left {
        display: none !important;
    }

    .controls .center #screen-share {
        display: none;
    }

    .videos-container .local-video #local-video-div {
        width: 200px;
        height: 112.5px;
    }
}

@media (max-width: 1030px) {}

@media (max-width: 768px) {
    body {
        padding: 2px;
    }

    aside {
        margin-left: 0;
    }
    .header {
        height: 10%
    }
    .main-container {
        height: 80%;
        padding: 5px;
    }

    footer {
        height: 10%;
    }
    .header h1{
        font-size: 22px;
    }
    .header p {
        font-size: 11px;
    }

    .videos-container {
        /*height: calc(100vh - 235px);*/
        height: 100%;
    }
}