/*
 * Layout styles extracted from MainLayout.razor
 * Contains styles for main layout structure, top bar, and user menu
 */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.sidebar {
    /* Styles moved to progetto-posa-theme.css */
}

.top-row {
    background-color: white;
    border-bottom: 3px solid #7B3F99;
    justify-content: space-between;
    height: 3.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.top-row a, .top-row ::deep a, .top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.top-row a:hover, .top-row ::deep a:hover, .top-row .btn-link:hover {
    text-decoration: underline;
}

.top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

    .top-row a, .top-row ::deep a, .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
        background-color: white;
        border-bottom: 3px solid #7B3F99;
    }

    .top-row.auth {
        justify-content: space-between;
    }

    .top-row a, .top-row ::deep a, .top-row .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
    }

    .top-row a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

/* Navbar Toggler in Top Row */
.top-row .navbar-toggler {
    background-color: rgba(123, 63, 153, 0.1);
    border: 1px solid #7B3F99;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-row .navbar-toggler:hover {
    background-color: rgba(123, 63, 153, 0.2);
}

.top-row .navbar-toggler-icon {
    display: block;
    width: 1.5em;
    height: 1.5em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(123, 63, 153, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* User Menu Styles */
.user-menu {
    display: flex;
    align-items: center;
    position: relative;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #7B3F99 0%, #9B5FB9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-menu .btn {
    color: #333 !important;
    border: none !important;
    background: none !important;
    padding: 0.25rem 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu .btn:hover {
    color: #7B3F99 !important;
}

.user-menu .btn:hover .avatar-circle {
    transform: scale(1.05);
}

.user-menu .btn:focus {
    box-shadow: none !important;
}

.user-menu .btn:after {
    display: none !important;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 2px;
}

.user-menu .bi-chevron-down {
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.user-menu .btn[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.user-menu .dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    min-width: 280px !important;
    max-width: 350px !important;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    position: absolute !important;
    z-index: 1050 !important;
    font-size: 0.9rem !important;
}

.user-menu .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.user-menu .dropdown-item {
    color: #333 !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 4px;
    margin: 0 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    width: auto !important;
    padding: 0.5rem 1rem !important;
}

.user-menu .dropdown-item:hover {
    background-color: rgba(123, 63, 153, 0.08) !important;
    color: #7B3F99 !important;
    transform: translateX(2px);
}

.user-menu .dropdown-item i {
    width: 20px !important;
    margin-right: 0.75rem !important;
    font-size: 1.1rem !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    color: #7B3F99 !important;
}

.user-menu .dropdown-item span {
    font-weight: 500;
    display: inline-block !important;
    white-space: nowrap !important;
}

.user-menu .dropdown-item:hover i {
    color: #7B3F99;
}

.user-menu .dropdown-item.text-danger {
    color: #dc3545 !important;
}

.user-menu .dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.08) !important;
    color: #dc3545 !important;
}

.user-menu .dropdown-item.text-danger i {
    color: #dc3545;
}

.user-menu .dropdown-divider {
    margin: 0.25rem 0;
    border-color: rgba(0, 0, 0, 0.08);
}

.user-menu .border-bottom {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.user-menu .dropdown-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.user-menu .dropdown-menu ul {
    margin: 0 !important;
    padding: 0 !important;
}