/**
 * Tailwind Custom Styles for CRM
 * Modern design elements matching calculadora-publica
 */

/* ===== ANIMATIONS ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-out;
}

/* Slide animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideInRight {
    animation: slideInRight 0.5s ease-out;
}

/* ===== LOADING SPINNER ===== */

.spinner {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #10b981;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    border-width: 2px;
    width: 24px;
    height: 24px;
}

.spinner-lg {
    border-width: 4px;
    width: 60px;
    height: 60px;
}

/* ===== GRADIENT BACKGROUNDS ===== */

.gradient-bg {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-bg-subtle {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.gradient-bg-dark {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Button gradients */
.gradient-green {
    background: linear-gradient(to right, #10b981, #059669);
}

.gradient-green:hover {
    background: linear-gradient(to right, #059669, #047857);
}

.gradient-blue {
    background: linear-gradient(to right, #3b82f6, #2563eb);
}

.gradient-blue:hover {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
}

.gradient-red {
    background: linear-gradient(to right, #ef4444, #dc2626);
}

.gradient-red:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c);
}

/* ===== GLASS MORPHISM EFFECT ===== */

.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-light {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* ===== CUSTOM SHADOWS ===== */

.shadow-soft {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.shadow-green {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.shadow-green-lg {
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
}

/* ===== CUSTOM BORDERS ===== */

.border-gradient {
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(135deg, #10b981, #059669);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* ===== TRANSITIONS ===== */

.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* ===== HOVER EFFECTS ===== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ===== CUSTOM SCROLLBAR ===== */

.scrollbar-thin::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 10px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* ===== FOCUS STATES ===== */

.focus-green:focus {
    outline: none;
    ring: 2px;
    ring-color: #10b981;
    border-color: transparent;
}

/* ===== CARD STYLES ===== */

.card-modern {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.card-modern:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ===== TABLE STYLES ===== */

.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.table-modern thead th {
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    border: none;
}

.table-modern thead th:first-child {
    border-top-left-radius: 0.5rem;
}

.table-modern thead th:last-child {
    border-top-right-radius: 0.5rem;
}

.table-modern tbody tr {
    background: white;
    transition: background-color 0.2s ease;
}

.table-modern tbody tr:hover {
    background: #f0fdf4;
}

.table-modern tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

/* ===== BADGE STYLES ===== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: #f3f4f6;
    color: #374151;
}

/* ===== BUTTON STYLES ===== */

.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #059669, #047857);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: linear-gradient(to right, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(to right, #dc2626, #b91c1c);
}

/* ===== FORM STYLES ===== */

.input-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-modern:focus {
    outline: none;
    border-color: transparent;
    ring: 2px;
    ring-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-modern::placeholder {
    color: #9ca3af;
}

.label-modern {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* ===== MODAL STYLES ===== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

/* ===== UTILITY CLASSES ===== */

.text-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    margin: 1.5rem 0;
}

/* ===== RESPONSIVE UTILITIES ===== */

@media (max-width: 768px) {
    .card-modern {
        border-radius: 0.75rem;
    }

    .btn-modern {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .glass,
    .glass-dark,
    .glass-light {
        background: white !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .gradient-bg {
        background: white !important;
    }

    .shadow-soft,
    .shadow-green,
    .shadow-green-lg {
        box-shadow: none !important;
    }
}
