/* ====================================
   Cuisin'Affaires Mobile App CSS
   Bootstrap 5 + Tabler Icons
   ==================================== */

:root {
    --ca-primary: #696cff;
    --ca-primary-rgb: 105, 108, 255;
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

body {
    padding-bottom: 70px;
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Primary color override for Bootstrap */
.btn-primary {
    --bs-btn-bg: var(--ca-primary);
    --bs-btn-border-color: var(--ca-primary);
    --bs-btn-hover-bg: #5a5eeb;
    --bs-btn-hover-border-color: #5a5eeb;
    --bs-btn-active-bg: #5a5eeb;
    --bs-btn-active-border-color: #5a5eeb;
}

.btn-outline-primary {
    --bs-btn-color: var(--ca-primary);
    --bs-btn-border-color: var(--ca-primary);
    --bs-btn-hover-bg: var(--ca-primary);
    --bs-btn-hover-border-color: var(--ca-primary);
    --bs-btn-active-bg: var(--ca-primary);
    --bs-btn-active-border-color: var(--ca-primary);
}

.text-primary { color: var(--ca-primary) !important; }
.spinner-border.text-primary { color: var(--ca-primary) !important; }

/* Mobile Header */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1030;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    color: #a1acb8;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.2s;
    min-width: 60px;
}

.bottom-nav-item.active { color: var(--ca-primary); }
.bottom-nav-item:hover { color: var(--ca-primary); text-decoration: none; }

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid var(--ca-primary);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.pwa-icon {
    width: 44px;
    height: 44px;
    background: rgba(var(--ca-primary-rgb), 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards */
.card {
    border-radius: 12px;
    transition: transform 0.15s ease;
}

.nav-card:active {
    transform: scale(0.97);
}

/* Calendar Grid (Month View) */
.calendar-grid {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--ca-primary);
    color: #fff;
}

.calendar-header-cell {
    text-align: center;
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 600;
}

.calendar-body { padding: 4px; }

.calendar-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-cell {
    text-align: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 8px;
    position: relative;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: background 0.15s;
}

.calendar-cell.empty { cursor: default; }
.calendar-cell:not(.empty):hover { background: rgba(var(--ca-primary-rgb), 0.06); }

.calendar-cell.today .day-number {
    background: var(--ca-primary);
    color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.calendar-cell.selected { background: rgba(var(--ca-primary-rgb), 0.1); }

.day-number { font-size: 13px; font-weight: 500; }

.event-dot {
    font-size: 9px;
    background: var(--ca-primary);
    color: #fff;
    border-radius: 10px;
    padding: 0 6px;
    line-height: 16px;
    font-weight: 600;
}

/* Modal */
.modal-content { border-radius: 16px; border: 0; }
.modal-dialog-centered { margin: 16px; }

/* Auth page */
.min-vh-100 { min-height: 100vh; }

/* Scrollbar */
::-webkit-scrollbar { display: none; }

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .bottom-nav { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
    .mobile-header { padding-top: env(safe-area-inset-top); }
}

/* Install modal animation */
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Small screen tweaks */
@media (max-width: 380px) {
    .calendar-header-cell { font-size: 10px; padding: 8px 2px; }
    .day-number { font-size: 12px; }
    .calendar-cell { padding: 6px 2px; min-height: 38px; }
}
