/* ==================================================================================
   PIXELFY - BASE CSS (Reset + Design System)
   Estilos fundamentais: variáveis, reset, tipografia, cores, botões
   ================================================================================== */

/* =================== VARIÁVEIS DO DESIGN SYSTEM =================== */
:root {
    /* Cores Primárias - Gradiente Roxo Moderno */
    --primary-50: #F5F3FF;
    --primary-100: #EDE9FE;
    --primary-200: #DDD6FE;
    --primary-300: #C4B5FD;
    --primary-400: #A78BFA;
    --primary-500: #8B5CF6;
    --primary-600: #7C3AED;
    --primary-700: #6D28D9;
    --primary-800: #5B21B6;
    --primary-900: #4C1D95;

    /* Cores Neutras - Sistema Profissional */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Cores de Feedback */
    --success-light: #D1FAE5;
    --success: #10B981;
    --success-dark: #059669;

    --warning-light: #FEF3C7;
    --warning: #F59E0B;
    --warning-dark: #D97706;

    --error-light: #FEE2E2;
    --error: #EF4444;
    --error-dark: #DC2626;

    --info-light: #DBEAFE;
    --info: #3B82F6;
    --info-dark: #2563EB;

    /* Variáveis Legado (compatibilidade com código antigo) */
    --primary: #7C3BC8;
    --primary-dark: #5A22AC;
    --primary-light: #9B6DD6;
    --secondary: #5377D8;
    --accent: #E74C3C;
    --light: #F8F9FA;
    --border: #DEE2E6;
    --card-bg: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #5F6C7B;
    --whatsapp: #25D366;
    --danger: #E74C3C;
    --cloudinary: #3448C5;
    --text: #2C3E50;
    --accent-purple: #8B5CF6;

    /* Gradientes Premium */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --gradient-info: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --gradient-dark: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    --gradient-mesh:
        radial-gradient(at 40% 20%, hsla(270, 91%, 65%, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(262, 83%, 58%, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(240, 100%, 67%, 0.05) 0px, transparent 50%);

    /* Sombras Modernas */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
    --shadow-glow-sm: 0 0 20px rgba(139, 92, 246, 0.2);

    /* Bordas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Espaçamentos */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Tipografia */
    --font-sans: 'Inter', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Poppins', 'Nunito', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transições */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* =================== RESET GLOBAL =================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    background-image: var(--gradient-mesh);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* =================== TIPOGRAFIA =================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

/* =================== BOTÕES PREMIUM =================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 59, 200, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: white;
}

.btn-whatsapp:hover {
    background: #1da851;
}

.btn-purple {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-purple:hover {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 59, 200, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-export {
    background: var(--info);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-premium {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    font-family: var(--font-sans);
    position: relative;
    overflow: hidden;
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-premium:hover::before {
    width: 300px;
    height: 300px;
}

.btn-premium-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-premium-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-premium-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.btn-premium-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

.btn-premium-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: var(--shadow-md);
}

/* =================== INPUTS E FORMULÁRIOS =================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all var(--transition-base);
    background: white;
    font-family: var(--font-sans);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 59, 200, 0.1);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

.input-premium {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-sans);
    background: white;
    transition: all var(--transition-base);
}

.input-premium:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.input-premium::placeholder {
    color: var(--gray-400);
}

/* =================== CARDS E CONTAINERS =================== */
.card-premium {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

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

.card-premium-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-100);
}

.card-premium-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-premium-body {
    color: var(--gray-700);
}

/* =================== BADGES =================== */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-success {
    background: #C6F6D5;
    color: #22543D;
}

.badge-warning {
    background: #FEFCBF;
    color: #744210;
}

.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-premium.purple {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-premium.success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-premium.warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-premium.error {
    background: var(--error-light);
    color: var(--error-dark);
}

/* =================== ALERTAS =================== */
.alert {
    padding: 15px;
    border-radius: var(--radius-md);
    margin: 15px 0;
    border: 1px solid;
}

.alert-success {
    background: #C6F6D5;
    color: #22543D;
    border-color: #9AE6B4;
}

.alert-error {
    background: #FED7D7;
    color: #742A2A;
    border-color: #FC8181;
}

.alert-warning {
    background: #FFF3CD;
    color: #856404;
    border-color: #FFEAA7;
}

/* =================== ANIMAÇÕES E UTILITÁRIOS =================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(
        90deg,
        var(--gray-200) 0%,
        var(--gray-100) 50%,
        var(--gray-200) 100%
    );
    background-size: 1000px 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.lift-on-hover {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.text-gradient {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* =================== UTILITÁRIOS GERAIS =================== */
.w-100 { width: 100%; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

/* =================== MODAL BASE =================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--secondary);
}

.modal-body {
    margin-bottom: 20px;
}
