<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="20dp"
    android:layout_marginVertical="8dp"
    app:cardCornerRadius="20dp"
    app:cardElevation="2dp"
    app:cardBackgroundColor="@color/colorSurface"
    app:strokeWidth="0dp">

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center_vertical">
            
            <TextView
                android:id="@+id/txtReservaRestaurante"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="Nome do Restaurante"
                android:textColor="@color/colorTextPrimary"
                android:textSize="20sp"
                android:textStyle="bold"
                android:fontFamily="sans-serif" />

            <com.google.android.material.chip.Chip
                android:id="@+id/chipReservaStatus"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Pendente"
                android:textSize="12sp"
                android:textStyle="bold"
                android:textColor="@color/colorChipPendingText"
                app:chipBackgroundColor="@color/colorChipPending"
                app:chipStrokeWidth="0dp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="8dp"
            android:gravity="center_vertical">
            
            <ImageView
                android:layout_width="16dp"
                android:layout_height="16dp"
                android:src="@android:drawable/ic_menu_recent_history"
                app:tint="@color/colorTextSecondary" />

            <TextView
                android:id="@+id/txtReservaDataHora"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:text="Hoje às 20:00"
                android:textColor="@color/colorTextSecondary"
                android:textSize="15sp" />
        </LinearLayout>
        
        <TextView
            android:id="@+id/txtReservaStatus"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone"
            android:text="Pendente" /> <!-- Kept for backward compatibility if needed in adapter -->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:orientation="horizontal">

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnCheckIn"
                android:layout_width="0dp"
                android:layout_height="52dp"
                android:layout_weight="1"
                android:layout_marginEnd="8dp"
                app:cornerRadius="12dp"
                app:backgroundTint="@color/colorPrimary"
                android:text="Check-in"
                android:textAllCaps="false"
                android:textStyle="bold"
                android:textColor="@color/white" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/btnCancelar"
                style="@style/Widget.Material3.Button.OutlinedButton"
                android:layout_width="0dp"
                android:layout_height="52dp"
                android:layout_weight="1"
                android:layout_marginStart="8dp"
                app:cornerRadius="12dp"
                app:strokeColor="@color/colorError"
                android:text="Cancelar"
                android:textAllCaps="false"
                android:textColor="@color/colorError" />
        </LinearLayout>

        <TextView
            android:id="@+id/txtLocationWarning"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="Dê permissões de localização para aceder ao check-in."
            android:textAlignment="center"
            android:textColor="@color/colorWarning"
            android:textSize="12sp"
            android:visibility="gone" />
    </LinearLayout>
</com.google.android.material.card.MaterialCardView>
