<?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/dayRoot"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bg_grid_cell_v4">

    <!-- Top Row: Day Number & Small Shift Badge (shown when memo exists) -->
    <LinearLayout
        android:id="@+id/topBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:layout_marginStart="4dp"
        android:layout_marginTop="2dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:id="@+id/dayNumber"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="12"
            android:textColor="@color/text_primary"
            android:textSize="13sp"
            android:textStyle="bold" />

        <!-- Small Shift Badge next to Day Number (shown when day has memo) -->
        <TextView
            android:id="@+id/tvShiftSmall"
            android:layout_width="wrap_content"
            android:layout_height="16dp"
            android:minWidth="16dp"
            android:layout_marginStart="4dp"
            android:gravity="center"
            android:text="주"
            android:textSize="9.5sp"
            android:textStyle="bold"
            android:textColor="@color/text_primary"
            android:background="@drawable/bg_shift_stroke_v4"
            android:paddingHorizontal="3dp"
            android:visibility="gone"/>
    </LinearLayout>

    <!-- Tide Text (top-right) -->
    <TextView
        android:id="@+id/tvTide"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="4dp"
        android:layout_marginTop="2dp"
        android:text="08:20"
        android:textColor="@color/text_tertiary"
        android:textSize="9sp"
        android:visibility="visible"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <!-- Standard Shift Abbreviation Circular Indicator (Center - shown when NO memo) -->
    <TextView
        android:id="@+id/shiftChar"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:gravity="center"
        android:text="주"
        android:textSize="20sp"
        android:textStyle="bold"
        android:textColor="@color/text_primary"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" 
        app:layout_constraintVertical_bias="0.45"/>

    <!-- Memo Content Text (Center/Body) - Up to 4 lines when memo exists -->
    <TextView
        android:id="@+id/memoContent"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:gravity="center"
        android:text="메모내용\n2줄\n3줄\n4줄"
        android:textSize="9.5sp"
        android:textColor="@color/secondary"
        android:lineSpacingMultiplier="1.05"
        android:maxLines="4"
        android:ellipsize="end"
        android:visibility="gone"
        android:layout_marginHorizontal="2dp"
        android:layout_marginTop="1dp"
        android:layout_marginBottom="1dp"
        app:layout_constraintTop_toBottomOf="@id/topBar"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"/>

    <!-- Holiday Name Small (Bottom) -->
    <TextView
        android:id="@+id/holidayNameSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="설날"
        android:textSize="9sp"
        android:textColor="@color/shift_red"
        android:layout_marginBottom="1dp"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

    <!-- Memo Indicator (bottom-right) -->
    <ImageView
        android:id="@+id/memoIndicator"
        android:layout_width="10dp"
        android:layout_height="10dp"
        android:layout_marginEnd="2dp"
        android:layout_marginBottom="2dp"
        android:src="@drawable/ic_memo"
        app:tint="@color/secondary"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
