/* Custom CSS para VetAssist */

/* Variables */
:root {
    --vet-primary: #2563eb;
    --vet-secondary: #059669;
    --vet-accent: #dc2626;
    --vet-dark: #1e293b;
    --vet-light: #f8fafc;
    --font-inter: 'Inter', system-ui, sans-serif;
}

/* Base */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-inter);
    background-color: var(--vet-light);
    color: var(--vet-dark);
    line-height: 1.6;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Form improvements */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Button improvements */
button {
    transition: all 0.2s ease-in-out;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Custom animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

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

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

.recording-dot {
    width: 8px;
    height: 8px;
    background-color: #dc2626;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Audio Wave Rings */
.wave-ring {
    position: absolute;
    border: 2px solid;
    border-radius: 50%;
    animation: wave-pulse 2s infinite;
}

.wave-ring-1 {
    inset: 10%;
    border-color: rgba(37, 99, 235, 0.6);
    animation-delay: 0s;
}

.wave-ring-2 {
    inset: 5%;
    border-color: rgba(37, 99, 235, 0.4);
    animation-delay: 0.5s;
}

.wave-ring-3 {
    inset: 0%;
    border-color: rgba(37, 99, 235, 0.2);
    animation-delay: 1s;
}

@keyframes wave-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Mobile Wave Rings */
.mobile-wave-ring {
    position: absolute;
    border: 2px solid;
    border-radius: 50%;
    animation: mobile-wave-pulse 2s infinite;
}

.mobile-wave-ring-1 {
    inset: 15%;
    border-color: rgba(5, 150, 105, 0.6);
    animation-delay: 0s;
}

.mobile-wave-ring-2 {
    inset: 5%;
    border-color: rgba(5, 150, 105, 0.4);
    animation-delay: 0.8s;
}

@keyframes mobile-wave-pulse {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Audio Level Bars */
.audio-bar {
    width: 4px;
    height: 20px;
    border-radius: 2px;
    animation: audio-bounce 1s infinite ease-in-out;
}

.audio-bar:nth-child(1) { animation-delay: -0.4s; }
.audio-bar:nth-child(2) { animation-delay: -0.3s; }
.audio-bar:nth-child(3) { animation-delay: -0.2s; }
.audio-bar:nth-child(4) { animation-delay: -0.1s; }
.audio-bar:nth-child(5) { animation-delay: 0s; }

@keyframes audio-bounce {
    0%, 80%, 100% {
        transform: scaleY(0.4);
    }
    40% {
        transform: scaleY(1);
    }
}

/* Waveform animation */
.waveform {
    height: 60px;
    background: linear-gradient(135deg, var(--vet-primary), var(--vet-secondary));
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

.waveform::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: wave 2s linear infinite;
}

@keyframes wave {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.3s ease-out;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success {
    background-color: #10b981;
    color: white;
}

.toast.error {
    background-color: #ef4444;
    color: white;
}

.toast.info {
    background-color: var(--vet-primary);
    color: white;
}

.toast.warning {
    background-color: #f59e0b;
    color: white;
}

/* Progress bar improvements */
.progress-bar {
    transition: width 0.3s ease-in-out;
    background: linear-gradient(90deg, var(--vet-primary), var(--vet-secondary));
}

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

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

/* Loading overlay */
.loading-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Scroll improvements */
.scroll-smooth {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Form validation styles */
.field-valid {
    border-color: var(--vet-secondary) !important;
    box-shadow: 0 0 0 1px var(--vet-secondary) !important;
}

.field-invalid {
    border-color: var(--vet-accent) !important;
    box-shadow: 0 0 0 1px var(--vet-accent) !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .toast {
        right: 16px;
        left: 16px;
        min-width: auto;
    }
    
    .waveform {
        height: 40px;
        border-radius: 20px;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
    /* Will be implemented later if needed */
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus improvements for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--vet-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: white;
    }
    
    .text-gray-600 {
        color: black;
    }
}

/* Simple Text Editor Styles */
#simple-editor {
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
}

#simple-editor h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 1rem 0;
    border-bottom: 2px solid #d1d5db;
    padding-bottom: 0.5rem;
}

#simple-editor h2 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #374151;
    margin: 1.25rem 0 0.75rem 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

#simple-editor h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 1rem 0 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.25rem;
}

#simple-editor p {
    margin: 0.5rem 0;
    color: #4b5563;
}

#simple-editor strong {
    font-weight: 600;
    color: #374151;
}

#simple-editor .flex {
    display: flex;
    align-items: flex-start;
    margin: 0;
    line-height: 1.4;
}

#simple-editor .flex span:first-child {
    color: #6b7280;
    margin-right: 0.5rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

#simple-editor .flex span:last-child {
    flex: 1;
    color: #4b5563;
    line-height: 1.4;
}

#simple-editor .mt-6 {
    margin-top: 1.5rem;
}

#simple-editor .mt-8 {
    margin-top: 2rem;
}

/* Document content styles (for viewing mode) */
#document-content .flex {
    display: flex;
    align-items: flex-start;
    margin: 0;
    line-height: 1.4;
}

#document-content .flex span:first-child {
    color: #6b7280;
    margin-right: 0.5rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

#document-content .flex span:last-child {
    flex: 1;
    color: #4b5563;
    line-height: 1.4;
}

#document-content .mt-6 {
    margin-top: 1.5rem;
}

#document-content .mt-8 {
    margin-top: 2rem;
}

#document-content .mt-12 {
    margin-top: 3rem;
}

#document-content .pt-6 {
    padding-top: 1.5rem;
}

#document-content .border-t {
    border-top: 1px solid #e5e7eb;
}

#document-content .text-center {
    text-align: center;
}

#simple-editor .mt-12 {
    margin-top: 3rem;
}

#simple-editor .pt-6 {
    padding-top: 1.5rem;
}

#simple-editor .border-t {
    border-top: 1px solid #e5e7eb;
}

#simple-editor .text-center {
    text-align: center;
}

#simple-editor em {
    font-style: italic;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Focus styling for contenteditable */
#simple-editor:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* Placeholder for empty editor */
#simple-editor:empty::before {
    content: 'Clique aqui para editar o documento...';
    color: #9ca3af;
    font-style: italic;
}