/* 
   Romance Cakes - "Logo Model" Theme
   Colors matched to the Romance Cake logo (Burgundy & Pink)
*/

:root {
    --primary-color: #6d1b32;
    /* Burgundy (from Logo Text/Ring) */
    --accent-color: #d65db1;
    /* Pink (from Logo Cherry/Icon) */
    --bg-color: #ffffff;
    /* White background (User Request) */
    --card-bg: #ffffff;
    --text-primary: #4a1222;
    /* Dark Burgundy Text */
    --text-secondary: #8c5e6d;
    /* Softer Burgundy */

    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Outfit', sans-serif;

    --radius: 20px;
    /* Large rounded corners from reference */
    --shadow: 0 4px 15px rgba(109, 27, 50, 0.08);
    /* Colored shadow */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 60px;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header w/ Full Color Theme --- */
.header {
    background: #ffffff;
    border-bottom: 3px solid var(--primary-color);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-container {
    display: flex;
    flex-direction: column;
    /* Mobile First: Stacked */
    align-items: center;
    gap: 10px;
}

@media (min-width: 600px) {
    .header-container {
        flex-direction: row;
        /* Desktop: Row */
        justify-content: space-between;
        gap: 0;
    }
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    /* Slightly smaller on mobile to fit */
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.2;
}

@media (min-width: 600px) {
    .logo h1 {
        font-size: 2.2rem;
    }
}

.nav-list {
    display: flex;
    gap: 15px;
    /* More space between links */
    list-style: none;
    padding: 5px 0;
}

.nav-list a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 8px 18px;
    /* Larger touch target */
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #f8f8f8;
    /* Subtle background for unactive */
}

.nav-list a.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(109, 27, 50, 0.2);
}

.hero-text {
    display: none;
}

@media (min-width: 768px) {
    .hero-text {
        display: block;
    }
}

/* --- Product Grid --- */
.book-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* 1 Column Mobile (Requested) */
    gap: 25px;
    padding: 30px 0;
}

@media (min-width: 600px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .book-grid {
        grid-template-columns: repeat(4, 1fr);
        /* 4 Columns Desktop (Reference) */
    }
}

/* --- Cards (Logo Model Style) --- */
.book-card {
    background: white;
    border-radius: var(--radius);
    /* 20px rounded */
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(109, 27, 50, 0.1);
    position: relative;
    text-align: left;
    /* Left align as per new reference */
}

.book-image-container {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    /* No grey background, transparency usually desired for cakes */
}

.book-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Keep whole cake visible */
    transition: transform 0.3s ease;
}

.book-card:hover .book-image {
    transform: scale(1.05);
}

.book-info h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    /* Darker grey/black for text */
    margin-bottom: 10px;
    line-height: 1.4;
    font-family: var(--font-body);
}

.book-author {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 25px;
}

.book-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Price as MRP style */
.book-price {
    font-size: 1rem;
    font-weight: 600;
    color: #444;
}

.book-price::before {
    content: 'MRP: ';
    font-weight: 400;
    color: #888;
}

/* Minimal Button or "Order" Text */
.buy-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    width: 100%;
    margin-top: 5px;
    transition: all 0.3s;
}

.buy-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- Admin Panel Layout --- */
.main-dashboard {
    background-color: #f7f9fc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 900px) {
    .main-dashboard {
        flex-direction: row;
    }

    .sidebar {
        display: block;
        /* Show on Desktop */
        width: 260px;
        background: white;
        border-right: 1px solid #eaeaea;
        height: 100vh;
        position: sticky;
        top: 0;
        padding: 20px;
    }
}

.sidebar {
    display: none;
    /* Hide on mobile by default */
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Admin Content Area --- */
.admin-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

.admin-actions {
    margin: 20px 0;
    display: flex;
    justify-content: flex-end;
}

.add-btn {
    background: linear-gradient(135deg, var(--accent-color), #ad1457);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(216, 27, 96, 0.3);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover {
    transform: translateY(-2px);
}

/* --- Admin Table (Desktop) --- */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    /* For smooth corners */
    border: 1px solid #eee;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #fff5f8;
    /* Very light pink header */
    border-bottom: 2px solid #ffeef2;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #444;
}

/* Image in Table */
.data-table td img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* Actions Column */
.action-btn {
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.edit-btn {
    color: #2196F3;
}

.delete-btn {
    color: #F44336;
}

.action-btn:hover {
    background: #f5f5f5;
}


/* --- Mobile Responsive Table (Card View) --- */
@media (max-width: 768px) {
    .table-container {
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        background: white;
        margin-bottom: 15px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        padding: 15px;
        border: 1px solid #f0f0f0;
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 8px 0;
        border-bottom: 1px solid #f9f9f9;
    }

    .data-table td:last-child {
        border-bottom: none;
        padding-top: 15px;
        justify-content: flex-end;
        gap: 15px;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #888;
        font-size: 0.9rem;
    }

    /* Mobile Image Fix */
    .data-table td[data-label="Image"] {
        justify-content: center;
        padding-bottom: 15px;
        border-bottom: 1px solid #eee;
    }

    .data-table td[data-label="Image"] img {
        width: 80px;
        height: 80px;
    }
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    /* Prevent zoom */
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.save-btn {
    background: var(--accent-color);
    color: white;
}

.cancel-btn {
    background: #e0e0e0;
    color: #333;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.error-message {
    padding: 20px;
    color: red;
    text-align: center;
}
