/*
 * TSCardápio - CSS Principal
 * Agregador de Cardápios Digitais
 */

/* ===========================================
   Material Symbols Configuration
   =========================================== */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* ===========================================
   CSS Variables
   =========================================== */
:root {
    --primary: #ff6816;
    --primary-rgb: 255, 104, 22;
    --primary-dark: #e9560a;
    --background-light: #f7f8fb;
    --background-dark: #081827;
    --surface-light: #ffffff;
    --surface-dark: #111f2f;
    --text-main: #101828;
    --text-secondary: #667085;
    --border-light: #e4e7ec;
    --border-dark: #253246;
}

/* Dark mode */
.dark {
    --primary: #ff6816;
    --background-light: #081827;
    --surface-light: #111f2f;
    --text-main: #ffffff;
    --text-secondary: #a9b5c5;
    --border-light: #253246;
}

/* ===========================================
   Base Styles
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    background: var(--background-light);
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 9999;
    padding: 10px 14px;
    border-radius: 8px;
    background: #081827;
    color: #fff;
    font-weight: 800;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================================
   Utility Classes (Tailwind-like)
   =========================================== */
.font-display {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.bg-primary {
    background-color: var(--primary);
}

.text-primary {
    color: var(--primary);
}

.border-primary {
    border-color: var(--primary);
}

.bg-background-light {
    background-color: var(--background-light);
}

.bg-background-dark {
    background-color: var(--background-dark);
}

.text-text-main {
    color: var(--text-main);
}

.text-text-secondary {
    color: var(--text-secondary);
}

.tracking-tight,
.tracking-wide,
.tracking-wider,
.tracking-widest,
[class*="tracking-["] {
    letter-spacing: 0 !important;
}

/* Safe area for mobile */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ===========================================
   Navigation Styles (Legacy compat)
   =========================================== */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(244, 140, 37, 0.1);
    color: var(--primary);
}

.nav-link.active {
    background-color: rgba(244, 140, 37, 0.15);
    color: var(--primary);
}

/* ===========================================
   Form Styles
   =========================================== */
.form-input {
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

/* Custom checkbox */
input[type="checkbox"] {
    accent-color: var(--primary);
}

/* Custom select arrow: remove a seta nativa para não exibir o ícone duplicado. */
select:not([multiple]) {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select[multiple] {
    background-image: none;
}

/* ===========================================
   Card Styles
   =========================================== */
.card {
    background: white;
    border-radius: 0.875rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===========================================
   Button Styles
   =========================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
    font-weight: 700;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 12px 24px rgba(var(--primary-rgb), 0.22);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* ===========================================
   Toggle Switch
   =========================================== */
.toggle-switch {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background-color: white;
    border-radius: 9999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.toggle-switch.active {
    background-color: var(--primary);
}

.toggle-switch.active::after {
    transform: translateX(1.25rem);
}

/* ===========================================
   Scrollbar
   =========================================== */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom scrollbar for desktop */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }
}

/* ===========================================
   Animations
   =========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s ease forwards;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ===========================================
   Line Clamp
   =========================================== */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ===========================================
   Print Styles
   =========================================== */
@media print {
    .no-print {
        display: none !important;
    }
}
