@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== RESET ===== */
* {
    box-sizing: border-box;
    font-family: 'Inter', 'Times New Roman';
    margin: 0;
    padding: 0;
}

/* ===== VARIABLES ===== */
:root {
    --panel-background-color: #fafafa;
    --panel-border-radius: 28px;
    --panel-gap: 16px; /* 24px*/
    --form-items-border-radius: 8px;
    --app-padding: 16px;
    --panel-padding: 24px;
    --hover-shadow: 0 0 10px black;
    --panel-shadow: 0 0 30px rgba(0, 0, 0, .08);
    --font-size-m: 16px;
    --font-size-sm: 14px;
}

/* ===== GENERAL STYLES ===== */
html {
    background-color: antiquewhite;
}

aside {
    display: none;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

/* ===== GENERAL LAYOUT ===== */
.homepage {
    isolation: isolate;
}

.app {
    background: #FAF7F0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: var(--app-padding);
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--panel-gap);
}

.right-column {
    display: grid;
    gap: var(--panel-gap);
    grid-template-rows: 2fr 1fr;
}

/* ===== PANELS LAYOUT ===== */
.panel {
    background: var(--panel-background-color);
    border-radius: var(--panel-border-radius);
    box-shadow: var(--panel-shadow);
    padding: var(--panel-padding);
}

.panel--rooms,
.panel--create-rooms {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== ROOM LIST / CARDS ===== */
.room-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 50vh;
    list-style: none;
    overflow-y: auto;
    padding: 20px;
}

.room-list__card {
    background: rgba(79, 136, 241, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    color: black;
    display: flex;
    font-size: var(--font-size-m);
    font-weight: 550;
    padding: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
    width: 100%;
}

.room-list__card[data-has-password="true"]::after {
    content: "🔒";
    margin-left: auto;
    filter: saturate(50%);
}

.room-list__card:is(:hover, :focus-visible) {
    box-shadow: var(--hover-shadow);
    cursor: pointer;
    transform: translateX(-4px);
}

/* ===== FORMS ===== */
.room-form {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 16px;
    justify-content: space-between;
}

.form-group {
    display: flex;
    flex-direction: column;
    font-size: var(--font-size-sm); /*children inherit it*/
    gap: 8px;
}

.form-group__input {
    border: 2px solid #e5e7eb;
    border-radius: var(--form-items-border-radius);
    padding: 12px;
}

.form-group__label {
    color: #374151;
}

.error {
    color: darkred;
    height: var(--font-size-sm);
}

.error--hidden {
    display: none;
}

.submit-btn {
    background: #2ea44f;
    border: none;
    border-radius: var(--form-items-border-radius);
    color: white;
    cursor: pointer;
    font-size: var(--font-size-m);
    font-weight: 600;
    padding: 14px;
    transition: box-shadow 0.2s
}

.submit-btn:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

/* ===== MODAL ===== */
.modal-container {
    align-items: center;
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    height: 100vh;
    justify-content: center;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transition: opacity 0.3s ease;
    width: 100%;
}

.modal-container--show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--panel-background-color);
    border-radius: var(--panel-border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 40px;
    width: 100%;
}

.modal__header {
    display: flex;
    justify-content: space-between;
}

.close-btn {
    align-items: center;
    aspect-ratio: 1/1;
    background-color: #733635;
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    font-size: 30px;
    font-weight: 900;
    height: 50px;
    justify-content: center;
    line-height: 50px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.close-btn:hover {
    box-shadow: var(--hover-shadow);
    cursor: pointer;
    transform: rotate(90deg) scale(1.1);
}

.form-group__input:disabled{
    background-color: #eeeeee;
    cursor: not-allowed;
}

/* ===== MISC / UTILITY CLASSES ===== */
.center {
    text-align: center;
}

.footer,
.subtitle,
.panel--terms-of-service__content{
    color: #6b7280;
    font-size: var(--font-size-sm);
}

.panel--terms-of-service__content{
    line-height: 1;
}

.subtitle {
    margin-top: 4px;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-wrap{
    white-space: nowrap;
}

@media (orientation: portrait) {
    .room-form {
        gap: 24px;
    }
}

@media (min-width: 540px) {
    :root {
        --panel-gap: 32px;
        --app-padding: 32px;
    }
}

@media (min-width: 1400px) and (orientation: landscape) {
    :root {
        --panel-gap: 24px;
        --app-padding: 20px 40px 10px;
    }

    html::before {
        background-image: url("../img/splotch_blue.svg"), url("../img/splotch_red.svg");
        background-position: -250px -200px, 1100px 200px;
        background-repeat: no-repeat;
        background-size: 70%;

        content: "";
        inset: 0;
        opacity: 0.6;

        pointer-events: none;
        position: fixed;
    }

    .homepage {
        display: grid;
        grid-template-columns:1fr 5fr 1fr;
        width: 100%;
    }

    .dashboard {
        display: grid;
        flex-grow: 1;
        gap: var(--panel-gap);
        grid-template-columns:1fr 1fr;
        min-height: 0;
    }

    aside {
        display: revert;
    }

    .app {
        background: #F6F7FA;
        border-radius: var(--panel-border-radius);
        box-shadow: var(--panel-shadow);
        height: 850px;
        padding: var(--app-padding);
        position: relative;
    }

    .app::before {
        background-image: url("../img/splotch_green.svg"), url("../img/splotch_yellow.svg");
        background-position: -200px 400px, 800px -150px;
        background-repeat: no-repeat;
        background-size: 70%;
        border-radius: var(--panel-border-radius);

        content: "";
        inset: 0;
        opacity: 0.8;

        pointer-events: none;
        position: absolute;
        z-index: 0;
    }

    .panel {
        z-index: 1;
    }

    .panel--rooms {
        min-height: 0;
    }

    .room-list {
        flex-grow: 1;
        height: auto;
    }

    .panel--create-rooms {
        flex-grow: 1;
    }

    .right-column {
        display: flex;
        flex-direction: column;
    }

    .modal {
        width: 60vw;
    }
}