/* ClariFai - CSS Personalizado Optimizado */
/* Alternativa a Tailwind CDN para producción */

/* Variables CSS personalizadas */
:root {
    --primary-color: #0057FF;
    --primary-hover: #1E40AF;
    --secondary-color: #6B7280;
    --accent-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --success-color: #10B981;
    
    --font-family: 'Inter', system-ui, sans-serif;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Reset y base */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: #1F2937;
    background-color: #F9FAFB;
}

/* Layout utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-sm {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-lg {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-xl {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Display utilities */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

/* Flexbox utilities */
.flex-1 {
    flex: 1 1 0%;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

/* Grid utilities */
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

/* Spacing utilities */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-white { color: #FFFFFF; }
.text-gray-50 { color: #F9FAFB; }
.text-gray-100 { color: #F3F4F6; }
.text-gray-200 { color: #E5E7EB; }
.text-gray-300 { color: #D1D5DB; }
.text-gray-400 { color: #9CA3AF; }
.text-gray-500 { color: #6B7280; }
.text-gray-600 { color: #4B5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1F2937; }
.text-gray-900 { color: #111827; }
.text-primary { color: var(--primary-color); }
.text-blue-600 { color: #2563EB; }
.text-green-600 { color: #16A34A; }
.text-red-600 { color: #DC2626; }
.text-yellow-400 { color: #FBBF24; }
.text-pink-600 { color: #DB2777; }
.text-purple-600 { color: #9333EA; }

/* Background colors */
.bg-white { background-color: #FFFFFF; }
.bg-gray-50 { background-color: #F9FAFB; }
.bg-gray-100 { background-color: #F3F4F6; }
.bg-gray-200 { background-color: #E5E7EB; }
.bg-gray-300 { background-color: #D1D5DB; }
.bg-gray-900 { background-color: #111827; }
.bg-primary { background-color: var(--primary-color); }
.bg-blue-600 { background-color: #2563EB; }
.bg-green-600 { background-color: #16A34A; }
.bg-red-600 { background-color: #DC2626; }
.bg-purple-600 { background-color: #9333EA; }
.bg-indigo-600 { background-color: #4F46E5; }
.bg-yellow-400 { background-color: #FBBF24; }
.bg-pink-600 { background-color: #DB2777; }
.bg-teal-600 { background-color: #0D9488; }
.bg-orange-600 { background-color: #EA580C; }

.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-primary { --tw-gradient-from: var(--primary-color); }
.to-blue-600 { --tw-gradient-to: #2563EB; }
.from-blue-50 { --tw-gradient-from: #EFF6FF; }
.to-indigo-50 { --tw-gradient-to: #EEF2FF; }
.from-blue-50 { --tw-gradient-from: #EFF6FF; }
.to-indigo-50 { --tw-gradient-to: #EEF2FF; }
.from-blue-50 { --tw-gradient-from: #EFF6FF; }
.to-green-50 { --tw-gradient-to: #F0FDF4; }

/* Border utilities */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }
.border-gray-200 { border-color: #E5E7EB; }
.border-gray-300 { border-color: #D1D5DB; }
.border-primary { border-color: var(--primary-color); }
.border-green-500 { border-color: #22C55E; }
.border-red-500 { border-color: #EF4444; }
.border-yellow-200 { border-color: #FEF08A; }

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.border-l-4 { border-left-width: 4px; }
.border-l { border-left-width: 1px; }

/* Shadow utilities */
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-4 { top: 1rem; }
.right-4 { right: 1rem; }
.z-50 { z-index: 50; }

/* Width and height utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-screen { height: 100vh; }

/* Object fit */
.object-cover { object-fit: cover; }

/* Cursor utilities */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* User select */
.select-none { user-select: none; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Transition */
.transition { transition-property: all; transition-duration: 150ms; }
.transition-all { transition-property: all; transition-duration: 300ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-duration: 150ms; }

/* Transform */
.transform { transform: translateZ(0); }
.scale-105 { transform: scale(1.05); }

/* Hover effects */
.hover\:bg-gray-100:hover { background-color: #F3F4F6; }
.hover\:bg-blue-700:hover { background-color: #1D4ED8; }
.hover\:bg-green-700:hover { background-color: #15803D; }
.hover\:text-gray-800:hover { color: #1F2937; }
.hover\:text-white:hover { color: #FFFFFF; }
.hover\:border-primary:hover { border-color: var(--primary-color); }

/* Focus */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }

/* Active states */
.active\:bg-gray-100:active { background-color: #F3F4F6; }

/* Responsive utilities */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .md\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .md\:py-8 { padding-top: 2rem; padding-bottom: 2rem; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
}

@media (min-width: 1280px) {
    .xl\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Loading spinner specifically */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Custom ClariFai styles */
.resource-option, .sector-option {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.resource-option:hover, .sector-option:hover {
    transform: translateY(-2px);
}

.resource-option:hover > div, .sector-option:hover > div {
    border-color: var(--primary-color) !important;
    background-color: #EFF6FF !important;
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.1);
}

/* Form styling */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: var(--border-radius);
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.1);
}

.form-input.border-red-500 {
    border-color: #EF4444;
}

.form-input.border-green-500 {
    border-color: #10B981;
}

/* Button styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--border-radius);
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #6B7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4B5563;
}

.btn-success {
    background-color: #10B981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card styling */
.card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Notification styling */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-success {
    background-color: #10B981;
    color: white;
}

.notification-error {
    background-color: #EF4444;
    color: white;
}

.notification-info {
    background-color: #3B82F6;
    color: white;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 0.75rem;
    background-color: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Utility classes for common patterns */
.opacity-75 { opacity: 0.75; }
.opacity-90 { opacity: 0.9; }

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

/* Star rating */
.text-yellow-400 {
    color: #FBBF24;
}

/* Icon utilities */
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* Print styles */
@media print {
    .no-print { display: none !important; }
    
    body { 
        font-size: 12pt; 
        line-height: 1.4; 
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .bg-gradient-to-br {
        background: var(--primary-color) !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}