/**
 * FILE: style.css
 * PATH: /assets/css/style.css
 * PURPOSE: Custom CSS styles, variables, and utility classes for CaboAmo
 * DEPENDENCIES (from): Tailwind CSS CDN (loaded in header)
 * DEPENDENCIES (to): Used by all public and dashboard pages
 * CREDIT: Custom designed by The Taino Resource Group LLC Technical Development Team
 */

/* ============================================================================
   CSS Custom Properties
   ============================================================================ */
:root {
    --brand-50:  #f5f3ff;
    --brand-100: #ede9fe;
    --brand-200: #ddd6fe;
    --brand-300: #c4b5fd;
    --brand-400: #a78bfa;
    --brand-500: #8b5cf6;
    --brand-600: #7c3aed;
    --brand-700: #6d28d9;
    --brand-800: #5b21b6;
    --brand-900: #4c1d95;

    --accent-500: #ec4899;
    --accent-600: #db2777;

    --emerald-500: #10b981;
    --emerald-600: #059669;

    --shadow-soft: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.10);
    --radius-card: 18px;
    --radius-btn: 12px;
    --radius-modal: 20px;
}

/* ============================================================================
   Base & App Background
   ============================================================================ */
.app-bg {
    background: linear-gradient(135deg, #f8f7ff 0%, #fdf2f8 50%, #f0fdf4 100%);
    min-height: 100vh;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* ============================================================================
   Card Component
   ============================================================================ */
.card {
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* ============================================================================
   Button Primary
   ============================================================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    color: white;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-700), var(--brand-800));
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================================
   Availability Badges
   ============================================================================ */
.badge-available {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
}

.badge-unavailable {
    background: rgba(156, 163, 175, 0.2);
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
}

/* ============================================================================
   Status Badges (Dashboard)
   ============================================================================ */
.badge-nuevo {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-preparando {
    background: #fef3c7;
    color: #b45309;
}

.badge-completado {
    background: #d1fae5;
    color: #047857;
}

.badge-default {
    background: #f3f4f6;
    color: #4b5563;
}

/* ============================================================================
   Modal
   ============================================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: var(--radius-modal);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================================
   Toggle Switch
   ============================================================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--emerald-500);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================================================
   Dashboard Navigation
   ============================================================================ */
.dash-nav-link {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
}

.dash-nav-link:hover {
    color: var(--brand-600);
    background: var(--brand-50);
}

.dash-nav-link.active {
    color: var(--brand-700);
    background: var(--brand-100);
    font-weight: 600;
}

.dash-nav-link-mobile {
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s;
}

.dash-nav-link-mobile:hover {
    color: var(--brand-600);
    background: var(--brand-50);
}

.dash-nav-link-mobile.active {
    color: var(--brand-700);
    background: var(--brand-100);
    font-weight: 600;
}

/* ============================================================================
   Toast Notification
   ============================================================================ */
#toast {
    animation: toastSlideIn 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* ============================================================================
   Order Card (Dashboard)
   ============================================================================ */
.order-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
    transition: box-shadow 0.2s ease;
}

.order-card:hover {
    box-shadow: var(--shadow-hover);
}

/* ============================================================================
   Responsive Tweaks
   ============================================================================ */
@media (max-width: 640px) {
    .modal {
        margin: 0.5rem;
        padding: 1.25rem;
        border-radius: 16px;
    }

    .card:hover {
        transform: none;
    }
}

/* ============================================================================
   Loading Spinner
   ============================================================================ */
.spinner {
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================================
   Form Focus States
   ============================================================================ */
input:focus, textarea:focus, select:focus {
    border-color: var(--brand-400) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
