/* ============================================================
   BuyAnything.in — assets/css/app.css
   Custom site-wide styles (supplements Tailwind + Bootstrap)
   ============================================================ */

/* Layout shell */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* Page container — 70% width on desktop */
.page-container {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 1280px) {
    .page-container { max-width: 72%; }
}

/* Card hover lift */
.card-hover {
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,.10);
}

/* AJAX spinner overlay */
#ajax-spinner {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
#ajax-spinner.active { display: flex; }

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 5px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: bany-spin .7s linear infinite;
}
@keyframes bany-spin { to { transform: rotate(360deg); } }

/* Flash alerts */
.flash-alert { animation: bany-slideDown .25s ease-out; }
@keyframes bany-slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Card shake animation (login error) */
@keyframes bany-shake {
    0%,100% { transform: translateX(0); }
    20%,60%  { transform: translateX(-6px); }
    40%,80%  { transform: translateX(6px); }
}
.shake { animation: bany-shake .4s ease; }

/* Image placeholder */
.img-placeholder {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2.5rem;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Admin sidebar */
.admin-sidebar { width: 240px; min-height: 100vh; flex-shrink: 0; }

/* Modal animations */
.bany-overlay { animation: bany-fadeIn .2s ease; }
@keyframes bany-fadeIn { from { opacity:0; } to { opacity:1; } }

.bany-modal-box { animation: bany-scaleIn .2s ease; }
@keyframes bany-scaleIn {
    from { opacity:0; transform:scale(.95); }
    to   { opacity:1; transform:scale(1); }
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Focus ring */
:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* Table responsive wrapper */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* SweetAlert2 toast override */
.swal-toast-popup { border-radius: 10px !important; }

/* Aspect ratio for product images */
.aspect-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.aspect-video img,
.aspect-video > * {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

/* Password strength bar */
#pwd-strength-bar { transition: width .3s ease, background-color .3s ease; }

/* Input error state */
.input-error { border-color: #ef4444 !important; }

/* Admin table row hover */
.admin-table tbody tr:hover { background-color: #f8fafc; }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .6rem;
    border-radius: 9999px;
    font-size: .72rem;
    font-weight: 600;
}

/* Responsive utility: hide on mobile */
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}