/**
 * ============================================
 * ECOIN - Estilos Principales
 * ============================================
 * CSS completo con responsive design y animaciones
 */

/* Variables CSS - Ya definidas en header.php en estilos inline */

/* Reset y configuración global */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #fff;
    line-height: 1.6;
}

/* Contenedor */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 48px;
}

h2 {
    font-size: 36px;
}

h3 {
    font-size: 24px;
}

h4 {
    font-size: 18px;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #0D2C49;
    transition: color 300ms ease-in-out;
}

a:hover {
    color: #BADB5E;
}

/* Imágenes responsivas */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #0D2C49;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Listas */
ul, ol {
    margin-left: 20px;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 8px;
}

/* Código */
code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #d73a49;
}

pre {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    color: inherit;
    background: none;
    padding: 0;
}

/* Blockquote */
blockquote {
    border-left: 4px solid #BADB5E;
    padding-left: 16px;
    margin-left: 0;
    margin-bottom: 1rem;
    color: #666;
    font-style: italic;
}

/* Divider */
hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 2rem 0;
}

/* Utilidades de espaciado */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }

.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }

/* Visibilidad */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: #666; }
.text-danger { color: #e74c3c; }
.text-success { color: #27ae60; }
.text-warning { color: #f39c12; }
.text-info { color: #3498db; }

.float-left { float: left; }
.float-right { float: right; }
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Display */
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

/* Flexbox */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Bordes y sombras */
.border {
    border: 1px solid #e5e5e5;
}

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.rounded {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.shadow-none {
    box-shadow: none;
}

/* Fondos */
.bg-white { background-color: #fff; }
.bg-light { background-color: #f8f9fa; }
.bg-dark { background-color: #0D2C49; }
.bg-primary { background-color: #0D2C49; }
.bg-accent { background-color: #BADB5E; }
.bg-danger { background-color: #e74c3c; }
.bg-success { background-color: #27ae60; }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: #0D2C49;
    color: #fff;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e5e5;
    border-radius: 50%;
    border-top-color: #BADB5E;
    animation: spin 0.8s linear infinite;
}

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

/* Pulse animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 600ms ease-out;
}

/* Slide animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 600ms ease-out;
}

.slide-in-right {
    animation: slideInRight 600ms ease-out;
}

.slide-in-up {
    animation: slideInUp 600ms ease-out;
}

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Posición */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Z-index */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* User select */
.select-none { user-select: none; }
.select-text { user-select: text; }

/* Transform */
.scale-105:hover { transform: scale(1.05); }
.scale-110:hover { transform: scale(1.1); }

.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Transitions */
.transition-all {
    transition: all 300ms ease-in-out;
}

.transition-colors {
    transition: background-color 300ms ease-in-out, color 300ms ease-in-out;
}

.transition-transform {
    transition: transform 300ms ease-in-out;
}

/* Width and Height */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }

.min-h-screen { min-height: 100vh; }

/* Max width */
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

/* Grid */
.grid {
    display: grid;
}

.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));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Aspect ratio */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

/* Scroll behavior */
.snap-x {
    scroll-snap-type: x mandatory;
}

.snap-y {
    scroll-snap-type: y mandatory;
}

/* Impresión */
@media print {
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* Dark mode (opcional) */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .bg-light {
        background-color: #2a2a2a;
    }
    
    table th {
        background-color: #2a2a2a;
        color: #BADB5E;
    }
    
    .border, .border-top, .border-bottom {
        border-color: #333;
    }
}
