<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/gestaoStaffRoot"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorBackground"
    tools:context=".GestaoStaffActivity">

    <com.google.android.material.button.MaterialButton
        android:id="@+id/btnVoltar"
        style="@style/Widget.Material3.Button.TextButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:text="← Voltar"
        android:textAllCaps="false"
        android:textColor="@color/colorTextSecondary"
        android:textSize="16sp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/txtTituloGestaoStaff"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Gestão de staff"
        android:textColor="@color/colorTextPrimary"
        android:textSize="28sp"
        android:fontFamily="sans-serif-medium"
        app:layout_constraintTop_toBottomOf="@id/btnVoltar"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:layout_marginTop="20dp" />

    <TextView
        android:id="@+id/txtDescricaoGestaoStaff"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="32dp"
        android:layout_marginTop="12dp"
        android:text="Zona para configurar turnos, equipas e disponibilidade do staff."
        android:textColor="@color/colorTextSecondary"
        android:textSize="14sp"
        android:textAlignment="center"
        app:layout_constraintTop_toBottomOf="@id/txtTituloGestaoStaff"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <com.google.android.material.card.MaterialCardView
        android:id="@+id/formStaff"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:layout_marginTop="24dp"
        app:cardCornerRadius="20dp"
        app:cardElevation="2dp"
        app:cardBackgroundColor="@color/colorSurface"
        app:strokeWidth="1dp"
        app:strokeColor="@color/colorDivider"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@id/txtDescricaoGestaoStaff">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="20dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Atribuir funcionário a uma mesa"
                android:textColor="@color/colorTextPrimary"
                android:textSize="16sp"
                android:fontFamily="sans-serif-medium" />

            <Spinner
                android:id="@+id/spinnerNomeStaff"
                android:layout_width="match_parent"
                android:layout_height="54dp"
                android:layout_marginTop="16dp"
                android:background="@drawable/input_bg"
                android:padding="0dp" />

            <Spinner
                android:id="@+id/spinnerMesaStaff"
                android:layout_width="match_parent"
                android:layout_height="54dp"
                android:layout_marginTop="12dp"
                android:background="@drawable/input_bg"
                android:padding="0dp" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnAtribuirStaff"
                android:layout_width="match_parent"
                android:layout_height="54dp"
                android:layout_marginTop="16dp"
                app:cornerRadius="12dp"
                app:backgroundTint="@color/colorPrimary"
                android:text="Guardar atribuição"
                android:textAllCaps="false"
                android:textColor="@color/white" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnEliminarStaff"
                style="@style/Widget.Material3.Button.TextButton"
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:layout_marginTop="8dp"
                android:text="Eliminar Funcionário"
                android:textAllCaps="false"
                android:textColor="@color/colorError" />

            <TextView
                android:id="@+id/txtMensagemStaff"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text=""
                android:textColor="@color/colorSuccess"
                android:textSize="13sp" />

        </LinearLayout>
    </com.google.android.material.card.MaterialCardView>

    <TextView
        android:id="@+id/txtListaStaffTitulo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="24dp"
        android:layout_marginTop="24dp"
        android:text="Funcionários e mesas"
        android:textColor="@color/colorTextPrimary"
        android:textSize="18sp"
        android:fontFamily="sans-serif-medium"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/formStaff" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/btnGerirMesasStaff"
        style="@style/Widget.Material3.Button.OutlinedButton"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:layout_marginEnd="24dp"
        app:cornerRadius="12dp"
        android:text="Gerir Mesas"
        android:textAllCaps="false"
        android:textSize="12sp"
        app:layout_constraintBottom_toBottomOf="@id/txtListaStaffTitulo"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@id/txtListaStaffTitulo" />

    <ListView
        android:id="@+id/listStaffMesas"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:layout_marginTop="16dp"
        android:layout_marginBottom="16dp"
        android:divider="@color/colorDivider"
        android:dividerHeight="1dp"
        android:scrollbars="none"
        android:clipToPadding="false"
        app:layout_constraintTop_toBottomOf="@id/txtListaStaffTitulo"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="24dp"
        android:layout_marginBottom="24dp"
        android:clickable="true"
        app:backgroundTint="@color/colorPrimary"
        app:tint="@color/white"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        tools:srcCompat="@tools:sample/avatars" />

</androidx.constraintlayout.widget.ConstraintLayout>
