:root {
  --primary: #D30000;
  --bg: #f4f7f6;
  --shadow: 0 10px 25px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: var(--bg); padding: 10px; }

#mainApp { max-width: 450px; margin: auto; background: white; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }

/* Calendar Grid */
.calendar-nav { display: flex; justify-content: space-between; align-items: center; padding: 15px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 10px; }
.calendar-day { border: 1px solid #f0f0f0; border-radius: 10px; padding: 10px 2px; text-align: center; cursor: pointer; background: #fff; transition: 0.2s; }
.calendar-day:hover { background: #fff5f5; }
.date-num { font-weight: bold; font-size: 1.1rem; }
.pasaran-text { font-size: 9px; color: #777; }
.sunday-red { color: red !important; }
.today-highlight { background: #fff9c4 !important; border: 2px solid #fbc02d !important; }
.selected-day { background: var(--primary) !important; border-color: var(--primary) !important; color: white !important; }
.selected-day .pasaran-text { color: white !important; }

/* Panel System */
.panel-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9000; backdrop-filter: blur(3px); }
.control-panel { position: fixed; bottom: -100%; left: 50%; transform: translateX(-50%); width: 100%; max-width: 450px; background: white; z-index: 9001; border-radius: 25px 25px 0 0; padding: 20px; transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.control-panel.active { bottom: 0; }
.panel-handle { width: 40px; height: 4px; background: #ddd; margin: 0 auto 15px; border-radius: 10px; }

/* Grid 12 Menu */
.ramalan-grid-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ramalan-menu-item { display: flex; flex-direction: column; align-items: center; background: #fcfcfc; border: 1px solid #f0f0f0; border-radius: 15px; padding: 12px 2px; cursor: pointer; transition: 0.2s; }
.ramalan-menu-item:active { transform: scale(0.9); background: #fff0f0; }
.ramalan-menu-item .icon-box { font-size: 24px; margin-bottom: 5px; }
.ramalan-menu-item span { font-size: 8px; font-weight: bold; color: #444; text-align: center; text-transform: uppercase; }

/* Modals */
.news-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: white; z-index: 10000; padding: 20px; overflow-y: auto; }
.token-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 11000; align-items: center; justify-content: center; }
.token-modal-content { background: white; padding: 25px; border-radius: 20px; width: 90%; max-width: 350px; text-align: center; }
.premium-badge { background: #FFD700; color: #000; font-size: 10px; padding: 4px 10px; border-radius: 10px; font-weight: bold; display: none; margin-top: 5px; }
.firebase-status { position: fixed; top: 10px; right: 10px; font-size: 9px; color: white; padding: 4px 10px; border-radius: 20px; z-index: 12000; }
.online { background: #4CAF50; }
.offline { background: #f44336; }

#detailBody img {
    max-width: 100%; /* Agar gambar ramalan tidak meluber keluar layar */
    height: auto;
    border-radius: 10px;
}

#detailBody h3 {
    margin-top: 15px;
    color: #D30000;
}

#searchDateInput {
    outline: none;
    font-size: 14px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

#searchDateInput:focus {
    border: 2px solid #333;
}

/* Memperbaiki tampilan icon share agar rapi */
.fab.fa-whatsapp {
    font-size: 1.2rem;
    vertical-align: middle;
}

.loading-spinner {
    text-align: center;
    padding: 30px;
    color: #666;
}

.prediction-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #D30000;
}

.lucky-item {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    font-size: 0.9em;
}

.jodoh-form input {
    width: 100%;
    padding: 10px;
    margin: 5px 0 15px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}

.btn-hitung {
    width: 100%;
    padding: 12px;
    background: #D30000;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.pwa-standalone .header-section {
    padding-top: 55px;
}

#mainApp {
    margin-top: 30px;
}