@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Poor+Story&display=swap');

:root {
    --bg-warm: #FDF6E3;
    /* Warm paper color */
    --accent-brown: #795548;
    --table-color: #A1887F;
    --table-border: #5D4037;
    --primary-btn: #FF7043;
    --text-dark: #3E2723;
}

body {
    font-family: 'Jua', 'Poor Story', sans-serif;
    background-color: var(--bg-warm);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Subtle dot pattern */
    background-image: radial-gradient(#D7CCC8 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Header & Branding */
header {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

.brand-badge {
    background: #FFF;
    border: 2px solid var(--accent-brown);
    color: var(--accent-brown);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.display-title {
    font-size: 2.2rem;
    color: #3E2723;
    margin: 0.5rem 0;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn-create-table,
.btn-main-action {
    background-color: var(--primary-btn);
    color: white !important;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-family: 'Jua', sans-serif;
    box-shadow: 0 4px 0px #E64A19;
    /* Cute 3D effect button */
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.2s;
    text-decoration: none;
    display: inline-block;
    margin: 0.2rem;
    cursor: pointer;
}

.btn-create-table:hover,
.btn-main-action:hover {
    background-color: #E64A19 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 0px #BF360C !important;
    transform: translateY(-2px);
    text-shadow: none !important;
}

.btn-create-table:active,
.btn-main-action:active {
    transform: translateY(4px);
    box-shadow: none !important;
    background-color: #BF360C !important;
    color: #FFFFFF !important;
}

.btn-create-table:focus,
.btn-main-action:focus {
    background-color: #E64A19 !important;
    color: #FFFFFF !important;
    outline: none !important;
    box-shadow: 0 4px 0px #BF360C !important;
}

.btn-explore {
    background-color: #8D6E63;
    color: white !important;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-family: 'Jua', sans-serif;
    box-shadow: 0 4px 0px #5D4037;
    transition: transform 0.1s, box-shadow 0.1s;
    text-decoration: none;
    display: inline-block;
    margin: 0.2rem;
}

.btn-explore:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Table Design (2D Top-Down View) */
/* Table Design (3D Isometric/Coin Style) */
.table-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 2rem auto 6rem;
    /* Increased bottom margin for 3D space */
    border-radius: 50%;
    /* Wood texture */
    background: radial-gradient(circle, #A1887F 0%, #8D6E63 100%);
    /* Thicker border for "side" of table */
    border: 8px solid #5D4037;
    border-bottom-width: 20px;
    /* Thicker bottom border for perspective thickness */
    box-shadow: 0 30px 40px rgba(0, 0, 0, 0.4);
    /* 3D Tilt */
    transform: perspective(1000px) rotateX(25deg);
    transform-style: preserve-3d;
}

/* Food Items (Ornaments) */
.food-item {
    position: absolute;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%) rotateX(-25deg);
    /* Counter-rotate to stand straight */
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.food-item:hover {
    z-index: 100 !important;
    transform: translate(-50%, -50%) rotateX(-25deg) scale(1.2) translateY(-10px);
}

.food-item img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.2));
}

.food-name-tag {
    position: absolute;
    bottom: -20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
    border: 1px solid #D7CCC8;
    color: #3E2723;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Landing Page Styles */
.logo-img {
    max-width: 140px;
    height: auto;
    margin: 0 auto 0.5rem;
    display: block;
}

/* Message List (Below Table) */
.message-list-section {
    position: relative;
    max-width: 600px;
    margin: 0 auto 5rem;
    padding: 3rem 1rem 0;
    /* Add top padding to clear floating elements */
    z-index: 5;
}

.msg-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #EFEBE9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.1s;
}

.msg-title-badge {
    text-align: center;
    margin-bottom: 2rem;
    display: block;
}

.msg-title-badge h5 {
    display: inline-block;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: #5D4037;
    font-weight: bold;
}

.msg-card:hover {
    border-color: var(--primary-btn);
}

.msg-icon {
    width: 45px;
    height: 45px;
}

.msg-content {
    flex: 1;
    min-width: 0;
}

.msg-author {
    font-weight: bold;
    font-size: 1rem;
    color: #5D4037;
}

.msg-preview {
    display: block;
    color: #8D6E63;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FAB (Write Button) */
.fab-write {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-btn);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 112, 67, 0.4);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s;
}

.fab-write:hover {
    transform: scale(1.1) rotate(10deg);
}

/* Modals */
.modal-content {
    border-radius: 20px;
    border: 0;
    background: #FFF8E1;
    font-family: 'Jua', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px dashed #D7CCC8;
    background: transparent;
}

.form-control {
    border: 2px solid #D7CCC8;
    border-radius: 10px;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-btn);
    box-shadow: none;
}

/* Mobile Responsiveness & Polish */
@media (max-width: 360px) {
    .table-wrapper {
        width: 280px;
        height: 280px;
        border-bottom-width: 15px;
    }

    .food-item {
        width: 50px;
        height: 50px;
    }

    .display-title {
        font-size: 1.8rem;
    }
}

.msg-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    /* List Layout */
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    gap: 15px;
    background: white;
    border-radius: 15px;
}

.msg-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.msg-content {
    flex: 1;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.msg-author {
    font-weight: bold;
    font-size: 1rem;
    color: #5D4037;
    margin-bottom: 4px;
}

.msg-preview {
    font-size: 0.95rem;
    color: #4E342E;
    white-space: normal;
    line-height: 1.4;
    word-break: break-word;
}

.msg-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    margin-top: 2px;
}