<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:background="@color/white"
        android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="@color/colorPrimary"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:titleEnabled="false">

            <ImageView
                android:id="@+id/restaurantCover"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                android:src="@drawable/na_mesa"
                app:layout_collapseMode="parallax" />

            <View
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@drawable/gradient_overlay" />

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:navigationIcon="@android:drawable/ic_menu_revert" />

        </com.google.android.material.appbar.CollapsingToolbarLayout>
    </com.google.android.material.appbar.AppBarLayout>

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

            <TextView
                android:id="@+id/detailName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fontFamily="sans-serif-black"
                android:text="Nome do Restaurante"
                android:textColor="@color/colorTextPrimary"
                android:textSize="28sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/detailCuisine"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Italiano"
                    android:textColor="@color/colorTextSecondary"
                    android:textSize="16sp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="8dp"
                    android:text="•"
                    android:textColor="@color/colorTextSecondary" />

                <TextView
                    android:id="@+id/detailRating"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="4.8 ★"
                    android:textColor="@color/colorWarning"
                    android:textSize="16sp"
                    android:textStyle="bold" />
            </LinearLayout>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="24dp"
                android:fontFamily="sans-serif-black"
                android:text="Sobre"
                android:textColor="@color/colorTextPrimary"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/detailDescription"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:lineSpacingExtra="4dp"
                android:text="Descrição do restaurante aparecerá aqui com todos os detalhes premium."
                android:textColor="@color/colorTextSecondary"
                android:textSize="15sp" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="24dp"
                android:fontFamily="sans-serif-black"
                android:text="Localização"
                android:textColor="@color/colorTextPrimary"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/detailAddress"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="Rua Principal, 123, Lisboa"
                android:textColor="@color/colorTextSecondary"
                android:textSize="15sp" />

            <!-- Spacer for bottom button -->
            <View
                android:layout_width="match_parent"
                android:layout_height="100dp" />

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        app:cardBackgroundColor="@color/white"
        app:cardCornerRadius="0dp"
        app:cardElevation="16dp"
        app:strokeWidth="0dp">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/btnReserveNow"
            style="@style/Widget.NaMesa.Button"
            android:layout_width="match_parent"
            android:layout_height="64dp"
            android:layout_margin="20dp"
            android:text="Reservar Mesa"
            android:textSize="18sp" />
    </com.google.android.material.card.MaterialCardView>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
