/* ===== REFINAMIENTO DE DISEÑO - BORDES REDONDEADOS ===== */
/* Fecha: 26 de Noviembre de 2024 */
/* Mejoras visuales manteniendo identidad pixel-art */

/* ===== 1. BORDES REDONDEADOS SUAVES ===== */

/* Botones principales */
.btn,
button,
.tutorial-btn {
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn:hover,
button:hover {
    transform: translateY(-2px);
}

/* Navegación */
.header {
    border-radius: 0;
}

.nav-link {
    border-radius: 0;
}

.dropdown-content {
    border-radius: 0;
    overflow: hidden;
}

.dropdown-link {
    border-radius: 0;
}

.dropdown-link:first-child {
    border-radius: 0;
}

.dropdown-link:last-child {
    border-radius: 0;
}

/* Cards y contenedores */
.section {
    border-radius: 12px;
}

.card,
.especie-card,
.project-card,
.criteria-card {
    border-radius: 10px;
}

/* Formularios */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="date"],
select,
textarea {
    border-radius: 6px;
}

/* Estados de validación */
.input-error,
.input-valid,
.input-warning {
    border-radius: 6px;
}

.error-message,
.success-message,
.warning-message {
    border-radius: 6px;
}

/* Modales y overlays */
.tutorial-modal,
.modal,
.popup {
    border-radius: 12px;
    overflow: hidden;
}

/* Toast notifications */
.error-toast,
.success-toast,
.warning-toast {
    border-radius: 10px;
}

/* Empty states */
.empty-state {
    border-radius: 12px;
}

/* Breadcrumbs */
.breadcrumb {
    border-radius: 8px;
}

.breadcrumb-item a {
    border-radius: 4px;
}

/* Badges y pills */
.badge {
    border-radius: 4px;
}

/* Progress bars */
.progress-bar {
    border-radius: 6px;
    overflow: hidden;
}

/* Skeleton screens */
.skeleton {
    border-radius: 8px;
}

/* Tooltips */
[data-tooltip]::before {
    border-radius: 6px;
}

/* ===== 2. SOMBRAS MEJORADAS ===== */

/* Sombras sutiles en lugar de pixel-art duras */
.btn,
button {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover,
button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.section {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card,
.especie-card,
.project-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover,
.especie-card:hover,
.project-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.tutorial-modal,
.modal {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.error-toast,
.success-toast,
.warning-toast {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ===== 3. TRANSICIONES SUAVES ===== */

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.btn,
button,
.nav-link,
.dropdown-link,
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 4. ESPACIADO Y PADDING MEJORADO ===== */

.btn,
button {
    padding: 12px 24px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.section {
    padding: 48px;
}

.card {
    padding: 24px;
}

/* ===== 5. GRADIENTES SUTILES ===== */

.header {
    background: #000;
}

.btn-primary {
    background: linear-gradient(135deg, #000 0%, #2d2d2d 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #000 100%);
}

.success-toast {
    background: linear-gradient(135deg, #fff 0%, #f8fff8 100%);
}

.error-toast {
    background: linear-gradient(135deg, #fff 0%, #fff8f8 100%);
}

.warning-toast {
    background: linear-gradient(135deg, #fff 0%, #fffef8 100%);
}

/* ===== 6. MEJORAS EN FOCUS STATES ===== */

*:focus-visible {
    outline: 3px solid #000;
    outline-offset: 3px;
    border-radius: 8px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}

/* ===== 7. MEJORAS EN HOVER STATES ===== */

.nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.dropdown-link:hover {
    background: rgba(0, 0, 0, 0.08);
    padding-left: 24px;
}

/* ===== 8. ICONOS Y BADGES REDONDEADOS ===== */

.btn-icon {
    border-radius: 4px;
}

.user-avatar,
.nav-user-avatar {
    border-radius: 50%;
}

/* ===== 9. TABLAS Y GRIDS ===== */

table {
    border-radius: 10px;
    overflow: hidden;
}

table th:first-child {
    border-radius: 10px 0 0 0;
}

table th:last-child {
    border-radius: 0 10px 0 0;
}

/* ===== 10. FORMULARIOS AVANZADOS ===== */

.form-group {
    margin-bottom: 24px;
}

.fieldset {
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

legend {
    padding: 8px 16px;
    border-radius: 6px;
    background: #000;
    color: #fff;
}

/* ===== 11. MEJORAS EN MODALES ===== */

.tutorial-overlay {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.6);
}

.tutorial-header {
    border-radius: 12px 12px 0 0;
}

.tutorial-footer {
    border-radius: 0 0 12px 12px;
}

/* ===== 12. MEJORAS EN NAVEGACIÓN MÓVIL ===== */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        border-radius: 8px;
    }
    
    .nav {
        border-radius: 12px;
    }
}

/* ===== 13. MEJORAS EN GRÁFICOS ===== */

.radar-container,
.chart-container {
    border-radius: 12px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

canvas {
    border-radius: 8px;
}

/* ===== 14. MEJORAS EN LISTAS ===== */

.species-list,
.project-list {
    display: grid;
    gap: 20px;
}

.list-item {
    border-radius: 10px;
    padding: 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.list-item:hover {
    border-color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== 15. MEJORAS EN FILTROS ===== */

.filter-section {
    border-radius: 10px;
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-select {
    border-radius: 6px;
}

/* ===== 16. LOADING STATES MEJORADOS ===== */

.btn-spinner {
    border-radius: 50%;
}

/* ===== 17. MEJORAS EN PAGINACIÓN ===== */

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.pagination button {
    border-radius: 6px;
    min-width: 40px;
    height: 40px;
}

.pagination button.active {
    background: #000;
    color: #fff;
}

/* ===== 18. ANIMACIONES MEJORADAS ===== */

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

.section,
.card {
    animation: fadeIn 0.5s ease;
}

/* ===== 19. MEJORAS EN STATS CARDS ===== */

.stat-card {
    border-radius: 12px;
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 32px;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ===== 20. MEJORAS EN HERO SECTION ===== */

.hero {
    border-radius: 16px;
    padding: 64px 48px;
    background: linear-gradient(135deg, #f9f9f9 0%, #fff 100%);
}

.hero-title {
    line-height: 1.3;
}

/* ===== 21. MEJORAS EN FOOTER ===== */

.footer {
    border-radius: 0;
    padding: 48px;
}

/* ===== 22. SCROLLBAR PERSONALIZADO ===== */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 6px;
    border: 2px solid #f5f5f5;
}

::-webkit-scrollbar-thumb:hover {
    background: #2d2d2d;
}

/* ===== 23. MEJORAS EN CÓDIGO/PRE ===== */

code,
pre {
    border-radius: 6px;
    padding: 4px 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

pre {
    padding: 16px;
    margin: 16px 0;
}

/* ===== 24. MEJORAS EN ALERTS ===== */

.alert {
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 2px solid;
}

.alert-success {
    background: #e8f8f0;
    border-color: #27ae60;
    color: #1e8449;
}

.alert-error {
    background: #ffe5e5;
    border-color: #e74c3c;
    color: #c0392b;
}

.alert-warning {
    background: #fff8e5;
    border-color: #f39c12;
    color: #d68910;
}

.alert-info {
    background: #e5f2ff;
    border-color: #3498db;
    color: #2471a3;
}

/* ===== 25. MEJORAS EN DIVIDERS ===== */

hr,
.divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
    margin: 32px 0;
}

/* ===== 26. MEJORAS RESPONSIVE ADICIONALES ===== */

@media (max-width: 768px) {
    .section {
        padding: 24px;
        border-radius: 8px;
    }
    
    .card {
        padding: 16px;
        border-radius: 8px;
    }
    
    .btn {
        border-radius: 6px;
    }
    
    .hero {
        padding: 32px 24px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 16px;
        border-radius: 6px;
    }
    
    .card {
        padding: 12px;
        border-radius: 6px;
    }
}

/* ===== 27. MEJORAS EN GRID LAYOUTS ===== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ===== 28. MEJORAS EN IMÁGENES ===== */

img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.avatar {
    border-radius: 50%;
}

.thumbnail {
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    border-color: #000;
    transform: scale(1.05);
}

/* ===== 29. MEJORAS EN CHIPS/TAGS ===== */

.chip,
.tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 16px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.chip:hover,
.tag:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* ===== 30. MEJORAS EN ACCORDIONS ===== */

.accordion-item {
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.accordion-header {
    padding: 16px 20px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.accordion-header:hover {
    background: #f0f0f0;
}

.accordion-content {
    padding: 20px;
}

/* ===== 31. MEJORAS EN TABS ===== */

.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}

.tab {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

.tab:hover {
    background: #f5f5f5;
}

.tab.active {
    background: #000;
    color: #fff;
    font-weight: 700;
}

/* ===== 32. MEJORAS DARK MODE PREPARADAS ===== */

@media (prefers-color-scheme: dark) {
    /* Preparado para futuro dark mode */
    /* Descomentado cuando se implemente */
    /*
    body {
        background: #1a1a1a;
        color: #f0f0f0;
    }
    
    .section,
    .card {
        background: #2d2d2d;
        border-color: #404040;
    }
    */
}

/* ===== 33. PRINT STYLES MEJORADOS ===== */

@media print {
    * {
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* ===== 34. MEJORAS EN PERFORMANCE ===== */

/* GPU acceleration para animaciones */
.btn,
.card,
.nav-link {
    will-change: transform;
}

/* ===== 35. UTILIDADES DE DISEÑO ===== */

.rounded-sm { border-radius: 4px; }
.rounded { border-radius: 6px; }
.rounded-md { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.shadow-md { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.shadow-xl { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15); }

/* ===== 36. EFECTOS ESPECIALES ===== */

.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glow-effect {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1),
                0 0 40px rgba(0, 0, 0, 0.05);
}

.gradient-border {
    position: relative;
    background: #fff;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #000, #666);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
