/* Mew - Custom Styles */

/* Layout pour footer sticky */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    margin-top: auto;
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Custom utility classes */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-pulse-slow {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth transitions */
* {
    transition-timing-function: ease-in-out;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Form styling */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Card hover effects */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark mode styles */
body.dark-mode {
    background-color: #1f2937;
    color: #f3f4f6;
}

body.dark-mode header {
    background-color: #111827;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
}

body.dark-mode .bg-white {
    background-color: #374151;
}

body.dark-mode .bg-gray-50 {
    background-color: #1f2937;
}

body.dark-mode .bg-gray-100 {
    background-color: #374151;
}

body.dark-mode .bg-gray-200 {
    background-color: #4b5563;
}

body.dark-mode .bg-gray-800 {
    background-color: #111827;
}

body.dark-mode .text-gray-800 {
    color: #f3f4f6;
}

body.dark-mode .text-gray-700 {
    color: #e5e7eb;
}

body.dark-mode .text-gray-600 {
    color: #d1d5db;
}

body.dark-mode .text-gray-500 {
    color: #9ca3af;
}

body.dark-mode .border-gray-200 {
    border-color: #4b5563;
}

body.dark-mode .border-gray-300 {
    border-color: #6b7280;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

body.dark-mode .hover\:bg-gray-50:hover {
    background-color: #4b5563;
}

body.dark-mode .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
}

/* Modal backdrop for dark mode */
body.dark-mode .bg-black.bg-opacity-50 {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Calendar specific dark mode */
body.dark-mode #calendarDays > div {
    border-color: #4b5563;
}

body.dark-mode #calendarDays > div:hover {
    background-color: #4b5563;
}

/* Tab styles for dark mode */
body.dark-mode .tab-btn {
    color: #d1d5db;
    border-color: transparent;
}

body.dark-mode .tab-btn:hover {
    color: #60a5fa;
    border-color: #60a5fa;
}

body.dark-mode .tab-btn.active {
    color: #3b82f6;
    border-color: #3b82f6;
}

/* Print styles */
@media print {
    header,
    footer,
    button {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .shadow,
    .shadow-lg {
        box-shadow: none !important;
    }
}

/* Responsive improvements */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .text-3xl {
        font-size: 1.875rem;
    }
    
    .text-2xl {
        font-size: 1.5rem;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom checkbox styling */
input[type="checkbox"] {
    cursor: pointer;
}

/* File input styling */
input[type="file"] {
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    margin-right: 0.5rem;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background-color: #2563eb;
}

body.dark-mode input[type="file"]::-webkit-file-upload-button {
    background-color: #2563eb;
}

body.dark-mode input[type="file"]::-webkit-file-upload-button:hover {
    background-color: #3b82f6;
}

/* Success/Error states */
.success {
    color: #10b981;
    background-color: #d1fae5;
    border-color: #34d399;
}

.error {
    color: #ef4444;
    background-color: #fee2e2;
    border-color: #f87171;
}

body.dark-mode .success {
    color: #34d399;
    background-color: #065f46;
    border-color: #10b981;
}

body.dark-mode .error {
    color: #f87171;
    background-color: #7f1d1d;
    border-color: #ef4444;
}

/* Animal icon animations */
.animal-icon {
    transition: transform 0.3s ease;
}

.animal-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Chart canvas for dark mode */
body.dark-mode canvas {
    filter: invert(0.9) hue-rotate(180deg);
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    font-size: 0.875rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Custom gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.gradient-info {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #78350f;
}

.badge-danger {
    background-color: #fee2e2;
    color: #7f1d1d;
}

body.dark-mode .badge-primary {
    background-color: #1e3a8a;
    color: #dbeafe;
}

body.dark-mode .badge-success {
    background-color: #065f46;
    color: #d1fae5;
}

body.dark-mode .badge-warning {
    background-color: #78350f;
    color: #fef3c7;
}

body.dark-mode .badge-danger {
    background-color: #7f1d1d;
    color: #fee2e2;
}