/* ============================================================
   Magic Moments Cake Shop — Main Stylesheet
   Beautiful, Realistic Bakery Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Design Tokens ──────────────────────────────────────── */
:root {
    --rose:         #E8456A;
    --rose-light:   #FF6B8A;
    --rose-pale:    #FFF0F3;
    --rose-soft:    #FFD6E0;

    --amber:        #F59E0B;
    --amber-light:  #FCD34D;
    --amber-pale:   #FFFBEB;

    --cream:        #FDF8F3;
    --warm-white:   #FFFFFF;
    --warm-gray:    #F9F5F0;

    --text-primary: #1A1A2E;
    --text-body:    #374151;
    --text-muted:   #6B7280;
    --text-subtle:  #9CA3AF;

    --border:       #F0E8E8;
    --border-focus: #E8456A;

    --success:      #10B981;
    --warning:      #F59E0B;
    --error:        #EF4444;
    --info:         #3B82F6;

    --shadow-xs:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm:    0 4px 12px rgba(0,0,0,.08);
    --shadow-md:    0 8px 24px rgba(0,0,0,.10);
    --shadow-lg:    0 16px 48px rgba(0,0,0,.14);
    --shadow-rose:  0 8px 24px rgba(232,69,106,.25);

    --radius-sm:    8px;
    --radius-md:    16px;
    --radius-lg:    24px;
    --radius-xl:    32px;

    --ease:         cubic-bezier(.4,0,.2,1);
    --transition:   all .3s var(--ease);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Base ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    background: var(--warm-gray);
    color: var(--text-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Loading Screen ─────────────────────────────────────── */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #1A1A2E 0%, #16213E 50%, #0F3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 20px rgba(232,69,106,.6));
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(232,69,106,.6)); }
    50%       { transform: scale(1.08); filter: drop-shadow(0 0 35px rgba(232,69,106,.9)); }
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: var(--rose-light);
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    letter-spacing: .5px;
    animation: fadeInOut 1.8s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: .5; }
    50%       { opacity: 1; }
}

/* ── App Container ──────────────────────────────────────── */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--warm-white);
    box-shadow: var(--shadow-lg);
    position: relative;
}

@media (min-width: 481px) and (max-width: 767px) {
    .app-container { max-width: 600px; }
}

@media (min-width: 768px) {
    .app-container { max-width: 100%; box-shadow: none; }
    body { background: var(--warm-gray); }
}

/* ── Header ─────────────────────────────────────────────── */
.app-header {
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 60%, #0F3460 100%);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,.25);
}

@media (min-width: 768px) {
    .app-header { padding: 16px 40px; }
    .header-content { max-width: 1200px; margin: 0 auto; }
}

@media (min-width: 1400px) {
    .header-content { max-width: 1400px; }
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(232,69,106,.4));
}

.brand-name {
    flex: 1;
    color: white;
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .3px;
    background: linear-gradient(90deg, #fff 0%, #FFD6E0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions { display: flex; gap: 10px; }

.icon-btn {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.15);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.icon-btn:hover, .icon-btn:active {
    background: rgba(232,69,106,.4);
    border-color: rgba(232,69,106,.5);
    transform: scale(1.05);
}

.icon-btn i { font-size: 19px; }

/* ── Main Content ───────────────────────────────────────── */
.main-content {
    padding: 20px;
    padding-bottom: 100px;
    min-height: calc(100vh - 140px);
}

@media (min-width: 768px) {
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 30px 40px 120px;
    }
}

@media (min-width: 1400px) {
    .main-content { max-width: 1400px; }
}

/* ── Bottom Navigation ──────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: 100%;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 10px;
    box-shadow: 0 -1px 0 rgba(0,0,0,.06), 0 -8px 32px rgba(0,0,0,.08);
    z-index: 99;
    border-top: 1px solid var(--border);
}

@media (min-width: 481px) and (max-width: 767px) {
    .bottom-nav { max-width: 600px; }
}

@media (min-width: 768px) {
    .bottom-nav {
        position: fixed;
        left: 0;
        transform: none;
        max-width: 100%;
        width: 100%;
        padding: 12px 0;
        justify-content: center;
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .bottom-nav { gap: 40px; }
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: var(--transition);
    padding: 6px 12px;
    border-radius: 12px;
    flex: 1;
    max-width: 80px;
    position: relative;
}

.nav-item i { font-size: 19px; transition: var(--transition); }
.nav-item span { font-size: 10px; font-weight: 600; letter-spacing: .3px; }

.nav-item.active {
    color: var(--rose);
}

.nav-item.active i {
    transform: translateY(-2px);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--rose);
    border-radius: 3px 3px 0 0;
}

.nav-item:hover { color: var(--rose); background: var(--rose-pale); }

@media (min-width: 768px) {
    .nav-item { padding: 10px 20px; max-width: 120px; }
    .nav-item i { font-size: 20px; }
    .nav-item span { font-size: 11px; }
}

/* ── Floating Cart ──────────────────────────────────────── */
.floating-cart {
    position: fixed;
    bottom: 86px;
    right: 18px;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--rose) 0%, #C0365A 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-rose);
    transition: var(--transition);
    z-index: 98;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-cart:hover, .floating-cart:active {
    transform: scale(1.12) rotate(-8deg);
    box-shadow: 0 12px 36px rgba(232,69,106,.45);
}

@media (min-width: 768px) {
    .floating-cart { bottom: 100px; right: 30px; width: 64px; height: 64px; }
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--amber);
    color: #1A1A2E;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
}

/* ── Modal ──────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,15,30,.65);
    z-index: 1000;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn .25s var(--ease);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 92%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    animation: slideUp .3s var(--ease);
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--rose-pale);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--rose);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.close-modal:hover { background: var(--rose); color: white; transform: rotate(90deg); }

/* ── User Menu ──────────────────────────────────────────── */
.user-info {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    font-size: 60px;
    color: var(--rose);
    margin-bottom: 10px;
    display: block;
}

.user-info h3 {
    font-family: var(--font-display);
    font-size: 20px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.user-info p { font-size: 13px; color: var(--text-muted); }

.menu-options { display: flex; flex-direction: column; gap: 10px; }

.menu-option {
    background: linear-gradient(135deg, var(--rose) 0%, #C0365A 100%);
    border: none;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    font-family: var(--font-body);
    box-shadow: var(--shadow-rose);
}

.menu-option:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    padding: 13px 26px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    letter-spacing: .2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rose) 0%, #C0365A 100%);
    color: white;
    box-shadow: var(--shadow-rose);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(232,69,106,.4);
}

.btn-secondary {
    background: white;
    color: var(--rose);
    border: 2px solid var(--rose);
}

.btn-secondary:hover { background: var(--rose); color: white; }

.btn-block { width: 100%; }

.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ── Input Fields ───────────────────────────────────────── */
.input-group { margin-bottom: 18px; }

.input-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-body);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: .3px;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-body);
    color: var(--text-body);
    background: white;
    transition: var(--transition);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(232,69,106,.12);
}

.input-group textarea { resize: vertical; min-height: 100px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(240,232,232,.6);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── Section Headers ────────────────────────────────────── */
.section-header { margin-bottom: 18px; }

.section-header h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.section-header p { color: var(--text-muted); font-size: 13px; }

/* ── Utility Classes ────────────────────────────────────── */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn .5s ease; }
.slide-up { animation: slideUp .5s ease; }

/* ── Skeleton Loader ────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0e8e8 25%, #f9f5f0 50%, #f0e8e8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* ── Cake Gallery Grid ──────────────────────────────────── */
.cake-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.cake-gallery-card {
    position: relative;
    height: 160px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.cake-gallery-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

.cake-gallery-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-md);
}

.cake-gallery-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    transition: transform .4s var(--ease);
}

.cake-gallery-card:hover img { transform: scale(1.06); }

.cake-gallery-card .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(15,15,30,.75));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 14px;
    color: white;
    text-align: center;
    z-index: 3;
}

.cake-gallery-card .card-overlay i {
    font-size: 24px;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.cake-gallery-card .card-overlay strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

@media (min-width: 481px) { .cake-gallery-card { height: 190px; } }

@media (min-width: 768px) {
    .cake-gallery { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .cake-gallery-card { height: 220px; }
    .cake-gallery-card:last-child:nth-child(odd) { grid-column: auto; }
}

@media (min-width: 1024px) { .cake-gallery-card { height: 260px; } }

/* ── Nav Item Sizing (Desktop) ──────────────────────────── */
@media (min-width: 768px) {
    .nav-item { padding: 12px 20px; max-width: 120px; }
    .nav-item i { font-size: 22px; }
    .nav-item span { font-size: 12px; }
}

@media (min-width: 1024px) {
    .nav-item { padding: 14px 24px; max-width: 140px; }
    .nav-item i { font-size: 24px; }
    .nav-item span { font-size: 13px; }
}

/* ── Auth Form Styles ───────────────────────────────────── */
.auth-form h2 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-subtle);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Toast Notifications ────────────────────────────────── */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 13px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    max-width: 88%;
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font-body);
    white-space: nowrap;
    animation: toastIn .3s var(--ease);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast-success { background: var(--success); color: white; }
.toast-error   { background: var(--error);   color: white; }
.toast-warning { background: var(--warning); color: white; }
.toast-info    { background: var(--info);    color: white; }

.toast i { font-size: 18px; }
