/* ========================================
   Owner Platform - Custom Styles
   TailwindCSS handles most styling via CDN
   This file adds animations, scrolling, 
   and components that Tailwind can't handle
   ======================================== */

/* Smooth scroll */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Selection */
::selection {
    background: #1A1A1A;
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    border: 3px solid #e7e7e7;
    border-top-color: #1A1A1A;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ===== ANIMATIONS ===== */
@keyframes scale-in {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.animate-scale-in {
    animation: scale-in 0.2s ease-out;
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

@keyframes slide-up {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-in-right {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
.animate-slide-in-right {
    animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-out-right {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}
.animate-slide-out-right {
    animation: slide-out-right 0.25s ease-in forwards;
}

/* ===== TESTIMONIAL SCROLL ===== */
.testimonial-scroll-container {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.testimonial-scroll {
    animation: scroll-left 40s linear infinite;
    width: max-content;
}

.testimonial-scroll:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== REVIEW SCROLL ===== */
.review-scroll-container {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
}

.review-scroll {
    animation: scroll-left 50s linear infinite;
    width: max-content;
}

.review-scroll:hover {
    animation-play-state: paused;
}

/* ===== FEATURE TABS ===== */
.feature-tab {
    border-color: #e7e7e7;
    color: #6d6d6d;
    background: #fff;
}
.feature-tab.active {
    border-color: #1A1A1A;
    color: #1A1A1A;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.feature-tab:hover:not(.active) {
    border-color: #b0b0b0;
    color: #1A1A1A;
}

/* ===== NAV SHADOW ON SCROLL ===== */
#main-nav.scrolled {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    max-width: 380px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    pointer-events: auto;
}
.toast-success {
    background: #fff;
    color: #065f46;
    border: 1px solid #d1fae5;
}
.toast-error {
    background: #fff;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.toast-info {
    background: #fff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-close {
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.toast-close:hover {
    opacity: 1;
}

/* ===== MOBILE MENU ===== */
.mobile-accordion .mobile-acc-btn svg {
    transition: transform 0.2s;
}
.mobile-accordion.open .mobile-acc-btn svg {
    transform: rotate(180deg);
}

/* ===== DASHBOARD SPECIFIC ===== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ensure charts render properly on mobile */
canvas {
    max-width: 100%;
}

/* ===== PWA INSTALL PROMPT ===== */
#pwa-install-banner {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== RESPONSIVE FIXES ===== */
@media (max-width: 640px) {
    .testimonial-scroll {
        animation-duration: 25s;
    }
    .review-scroll {
        animation-duration: 30s;
    }
}

/* Print styles */
@media print {
    nav, footer, .toast, #loading-modal, #sidebar, header { display: none !important; }
    main { padding: 0 !important; }
    body { background: #fff !important; }
}

/* ===== FOCUS STYLES ===== */
*:focus-visible {
    outline: 2px solid #1A1A1A;
    outline-offset: 2px;
    border-radius: 4px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: none;
}

/* ===== PREVENT DOUBLE TAP ZOOM ON BUTTONS (mobile) ===== */
button, a {
    touch-action: manipulation;
}
