/**
 * EsLleida.com - Estilos personalizados
 */

/* Animaciones */
@keyframes slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scale-in {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slide-in 0.3s ease-out;
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out;
}

.animate-scale-in {
    animation: scale-in 0.2s ease-out;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Selección de texto */
::selection {
    background: rgba(163, 189, 48, 0.3);
    color: inherit;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid #a3bd30;
    outline-offset: 2px;
}

/* Transiciones suaves para cards */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a3bd30;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Rating stars */
.rating-stars {
    display: inline-flex;
    gap: 2px;
}

.rating-stars .star {
    color: #e2e8f0;
    cursor: pointer;
    transition: color 0.15s ease;
}

.rating-stars .star.active,
.rating-stars .star.hovered {
    color: #eab308;
}

/* Truncate text */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Form inputs */
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #a3bd30;
    box-shadow: 0 0 0 4px rgba(163, 189, 48, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-textarea {
    min-height: 120px;
    padding: 12px 16px;
    resize: vertical;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.form-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #a3bd30;
    color: white;
    box-shadow: 0 4px 12px rgba(163, 189, 48, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(163, 189, 48, 0.4);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-outline {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-outline:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

/* Tags/Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(163, 189, 48, 0.1);
    color: #a3bd30;
}

.badge-success {
    background: #dcfce7;
    color: #16a34a;
}

.badge-warning {
    background: #fef9c3;
    color: #ca8a04;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge-info {
    background: #e0f2fe;
    color: #0284c7;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scale-in 0.2s ease-out;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Image aspect ratios */
.aspect-card {
    aspect-ratio: 4/3;
}

.aspect-banner {
    aspect-ratio: 16/9;
}

.aspect-square {
    aspect-ratio: 1/1;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: #1e293b;
    color: white;
    font-size: 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Dark mode adjustments */
.dark .form-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .form-input:focus {
    border-color: #a3bd30;
}

.dark .modal-content {
    background: #1e293b;
}

.dark .mobile-menu {
    background: #0f172a;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .form-input {
        height: 44px;
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }
    
    main {
        padding-top: 0 !important;
    }
}
