:root {
    --input-primary-color: #699a45;
}

* {
    box-sizing: border-box;
}

p,
span,
div,
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--font-color);
}

header.app-header {
    height: 100vh;
    width: 70px;
    position: fixed;
    top: 0;
    left: 0;
    flex-direction: column;
    padding: 20px 0 10px 0;
    box-shadow: none;
    border-right: 1px solid #e6e6e6;

    background: #eaeee7;

    .app-title {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;

        img {
            margin: 0;
        }

        .icon-button span {
            color: rgb(97, 106, 93);
        }
    }

    .login {
        padding: 0;
        margin: 0;
        width: 50px;
        height: 50px;
        border-radius: 25px;
        font-size: larger;
    }
}

.account-view-frame {
    left: 80px;
    bottom: 10px;
    top: auto;
    right: auto;
    transform-origin: bottom left;
}

#account img {
    scale: 1.3;
}

.recent-access {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    overflow-y: auto;
    border-left: 1px solid #e6e6e6;
    background: #eaeee7;

    .recent-access-container {
        padding: 20px;

        .top-text {
            font-size: x-large;
            color: rgb(97, 106, 93);
        }
    }
}

.main-view {
    position: fixed;
    top: 0;
    left: 70px;
    right: 300px;
    bottom: 0;
    overflow-y: auto;

    .view-tab-group {
        position: fixed;
        top: 0;
        left: 70px;
        right: 300px;
        height: 60px;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        border-bottom: 1px solid #eaeee7;

        .view-tab {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: large;
            font-weight: 600;
            color: rgb(97, 106, 93);
            transition: background-color 0.2s ease-out, border-bottom 0.2s ease-out;
            position: relative;
            user-select: none;

            &:hover {
                background-color: #f5f5f5;
            }

            &.selected::after {
                content: '';
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                height: 3px;
                background-color: #699a45;
                animation: slideIn 0.3s ease-out;
            }
        }

    }

    .selected-view {
        position: fixed;
        top: 60px;
        left: 70px;
        right: 300px;
        bottom: 0;
        overflow-y: auto;
        background-color: white;
        transition: opacity 0.2s ease-out, transform 0.2s ease-out;

        .main-view-container {
            padding: 20px;
            transition: opacity 0.2s ease-out, transform 0.2s ease-out;

            .top-text {
                font-size: x-large;
                color: rgb(97, 106, 93);
            }
        }
    }

    .space-header {
        position: fixed;
        top: 0;
        left: 70px;
        right: 300px;
        height: 60px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        border-bottom: 1px solid #eaeee7;
        gap: 10px;

        .space-title {
            font-size: x-large;
            color: rgb(97, 106, 93);
        }

        .user-icon {
            width: 30px;
            height: 30px;
            border-radius: 15px;
            user-select: none;
            -webkit-user-drag: none;
            cursor: pointer;
        }
    }
}

.space-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.space-card {
    background: white;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        border-color: #699a45;
    }

    h3 {
        margin: 0 0 10px 0;
        color: #333;
        font-size: 1.2em;
    }

    p {
        margin: 0 0 15px 0;
        color: #666;
        line-height: 1.4;
    }
}

.space-meta {
    font-size: 0.9em;
    color: #699a45;
    font-weight: 500;
}

.input-area {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem;
    transition: border-color 0.2s;
    cursor: text;
}

.input-area:focus-within:not(:has(button:focus)) {
    border-color: #666666;
}

.input-area textarea {
    width: 100%;
    padding: 0;
    border: none;
    resize: none;
    height: 24px;
    min-height: 24px;
    max-height: 88px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
    background-color: transparent;
    color: var(--text-primary);
    font-family: inherit;
    box-sizing: border-box;
}

.input-area textarea::placeholder {
    color: var(--text-secondary);
}

.input-area textarea:focus {
    outline: none;
}

.tool-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    cursor: text;
}

.tool-buttons-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tool-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-button:focus {
    outline: none;
}

.tool-button:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.send-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
    width: 32px;
    height: 32px;
}

.send-button:focus {
    outline: none;
}

.send-button:hover {
    background-color: var(--input-dark-primary-color);
    transform: scale(1.05);
}

.send-button:active {
    transform: scale(0.95);
}

.send-button svg {
    width: 18px;
    height: 18px;
}

.input-area-wrapper {
    background-color: var(--bg-secondary);
    padding: 1rem 1.5rem;
    position: fixed;
    bottom: 0;
    left: 70px;
    right: 300px;
}

.chat-area {
    position: fixed;
    left: 70px;
    right: 300px;
    top: 60px;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    padding: 1rem;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;

    .chat-message {
        margin: 5px 20px;
        display: flex;
        flex-direction: row;
        align-items: start;
        gap: 10px;

        .user-icon {
            width: 36px;
            height: 36px;
            border-radius: 18px;
            user-select: none;
            -webkit-user-drag: none;
            cursor: default;
            margin-top: 20px;
        }

        .message-content {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            align-items: start;

            .message-header {
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: 5px;
                font-size: smaller;
                height: 20px;

                .time {
                    color: var(--sub-font-color);
                }

                .user-name {
                    color: var(--font-color);
                    font-weight: 700;
                }
            }

            .message-bubble {
                background-color: #e3e8df;
                padding: 10px;
                border-radius: calc(10px + 0.5lh);
                color: var(--font-color);
                font-size: 16px;
                white-space: pre-wrap;
            }
        }

        &.mine {
            flex-direction: row-reverse;

            .message-content {
                align-items: end;
            }
        }
    }
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}