// Full-width / full-height three-column hub: 20% | 60% | 20%

// Stretch through Odoo's action manager so the hub fills the content area
.o_action_manager:has(.o_my_company_hub) {
    height: 100%;

    > .o_action.o_my_company_hub {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: 0;
    }
}

.o_content:has(.o_my_company_hub) {
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    display: flex;
    flex-direction: column;
}

.o_my_company_hub.o_action {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    flex: 1 1 auto;
    align-items: stretch;
    align-self: stretch;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0;
    overflow: hidden;
    background: var(--o-view-background-color, #fff);
    color: inherit;
    padding: 0;
    margin: 0;
}

.o_my_company_col {
    min-height: 0;
    height: 100%;

    &--left {
        flex: 0 0 var(--mc-left-width, 20%);
        width: var(--mc-left-width, 20%);
        max-width: none;
        min-width: 0;
        border-right: none;
        background: var(--o-view-background-color, #fff);
        padding: 1rem 0.75rem;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    &--center {
        flex: 1 1 var(--mc-center-width, 60%);
        width: var(--mc-center-width, 60%);
        min-width: 0;
        overflow-y: auto;
        padding: 1rem 1.25rem 2rem;
        background: var(--o-webclient-background-color, #f8f9fa);
    }

    &--right {
        flex: 0 0 var(--mc-right-width, 20%);
        width: var(--mc-right-width, 20%);
        max-width: none;
        min-width: 0;
        border-left: none;
        background: var(--o-view-background-color, #fff);
        padding: 1rem 0.75rem;
        overflow-y: auto;
    }
}

.o_my_company_resize_handle {
    flex: 0 0 6px;
    width: 6px;
    cursor: col-resize;
    background: transparent;
    align-self: stretch;
    position: relative;
    z-index: 3;
    touch-action: none;
    transition: background 0.15s;

    &::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 2px;
        width: 2px;
        background: var(--border-color, #dee2e6);
    }

    &:hover,
    &--active {
        background: rgba(113, 75, 103, 0.12);

        &::after {
            background: var(--o-brand-primary, #714b67);
            width: 3px;
            left: 1px;
        }
    }
}

body.o_my_company_resizing {
    cursor: col-resize !important;
    user-select: none !important;
}

// Feed uses the full centre column width
.o_my_company_center_inner {
    width: 100%;
    max-width: none;
    margin: 0;
}

.o_my_company_section_title {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 0.65rem;
    padding: 0 0.35rem;
}

.o_my_company_widget_header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

.o_my_company_brand {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem 0.5rem 0.85rem;
    margin-bottom: 0.25rem;
}

.o_my_company_logo {
    width: 100%;
    max-width: 160px;
    height: auto;
    max-height: 72px;
    object-fit: contain;
}

.o_my_company_hub_name {
    margin: 0.65rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    color: inherit;
}

.o_my_company_profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;

    &:hover {
        background: var(--bs-tertiary-bg, #f8f9fa);
    }
}

.o_my_company_profile_name {
    font-weight: 600;
    font-size: 0.95rem;
}

.o_my_company_apps {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.o_my_company_app_btn,
.o_my_company_contact_btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 0.375rem;
    padding: 0.5rem 0.55rem;
    text-align: left;
    color: inherit;

    &:hover {
        background: var(--bs-tertiary-bg, #f8f9fa);
    }
}

.o_my_company_app_icon {
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    object-fit: cover;
    flex-shrink: 0;

    &--fallback {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--o-brand-primary, #714b67);
        color: #fff;
        font-weight: 700;
    }

    &--fa {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        i {
            font-size: 1rem;
            line-height: 1;
        }
    }
}

.o_my_company_app_label,
.o_my_company_contact_name {
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.o_my_company_search_bar {
    position: relative;
    margin-bottom: 0.85rem;

    &--compact {
        margin-bottom: 0.5rem;
    }

    .form-control {
        padding-left: 2.2rem;
        border-radius: 2rem;
    }
}

.o_my_company_search_icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color, #6c757d);
    z-index: 1;
    pointer-events: none;
}

.o_my_company_composer {
    background: var(--o-view-background-color, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.o_my_company_composer_top {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin-bottom: 0.65rem;
}

.o_my_company_composer_input {
    border-radius: 1.5rem;
    resize: none;
}

.o_my_company_composer_extra {
    margin-bottom: 0.5rem;
}

.o_my_company_composer_actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color, #dee2e6);
    padding-top: 0.55rem;
    margin-top: 0.35rem;
}

.o_my_company_composer_types {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.o_my_company_action_btn {
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color, #6c757d);
    border-radius: 0.375rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;

    &:hover,
    &.active {
        background: var(--bs-tertiary-bg, #f8f9fa);
        color: inherit;
    }

    i {
        margin-right: 0.25rem;
    }
}

.o_my_company_posts {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.o_my_company_post {
    background: var(--o-view-background-color, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 0.375rem;
    padding: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);

    &--pinned {
        border-left: 3px solid var(--o-brand-primary, #714b67);
    }
}

.o_my_company_post_header {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
}

.o_my_company_post_title {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.o_my_company_post_images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin: 0.65rem 0;
}

.o_my_company_post_images--single {
    grid-template-columns: 1fr;
}

.o_my_company_post_image {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
}

.o_my_company_post_images--single .o_my_company_post_image {
    max-height: 480px;
}

.o_my_company_post_tags,
.o_my_company_meta,
.o_my_company_contact_sub,
.o_my_company_bday_label {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.82rem;
}

.o_my_company_bday_label--today {
    color: var(--bs-success, #198754);
    font-weight: 600;
}

.o_my_company_badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-secondary-color, #6c757d);

    &--kudos {
        background: rgba(255, 193, 7, 0.15);
        color: #997404;
        margin-left: 0.35rem;
    }

    &--announcement {
        background: rgba(13, 110, 253, 0.12);
        color: #0d6efd;
        margin-left: 0.35rem;
    }
}

.o_my_company_avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;

    &--sm {
        width: 36px;
        height: 36px;
    }

    &--xs {
        width: 32px;
        height: 32px;
    }
}

.o_my_company_avatar_wrap {
    position: relative;
    flex-shrink: 0;
}

.o_my_company_status {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--o-view-background-color, #fff);

    &--online { background: #198754; }
    &--away { background: #ffc107; }
    &--busy { background: #dc3545; }
    &--offline { background: #6c757d; }
}

.o_my_company_comments {
    border-top: 1px solid var(--border-color, #dee2e6);
    margin-top: 0.75rem;
    padding-top: 0.65rem;
}

.o_my_company_comment {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.o_my_company_comment_body {
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 1rem;
    padding: 0.4rem 0.75rem;
    flex: 1;
    min-width: 0;
}

.o_my_company_comment_form {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.35rem;

    .form-control {
        border-radius: 1rem;
    }
}

.o_my_company_widget {
    margin-bottom: 1.25rem;
}

.o_my_company_contacts {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.o_my_company_contact_info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    text-align: left;
}

.o_my_company_empty {
    text-align: center;
    color: var(--bs-secondary-color, #6c757d);
    padding: 2.5rem 1rem;

    &--compact {
        padding: 1rem 0.5rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 767px) {
    .o_my_company_hub.o_action {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        overflow: auto;
    }

    .o_my_company_resize_handle {
        display: none;
    }

    .o_my_company_col--left {
        display: none;
    }

    .o_my_company_col--center,
    .o_my_company_col--right {
        flex: none;
        width: 100%;
        height: auto;
    }

    .o_my_company_col--right {
        border-left: 0;
        border-top: 1px solid var(--border-color, #dee2e6);
        max-height: 260px;
    }
}
