/* Baiacu - Estilos principais */

/* Reset e configurações base */
body {
    -webkit-tap-highlight-color: transparent;
}

/* Safari-specific optimizations */
@supports (-webkit-appearance: none) {
    .image-container {
        transform: translateZ(0);
        /* Force hardware acceleration */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    img {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

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

/* Prevent layout shifts during image loading */
.aspect-square {
    aspect-ratio: 1 / 1;
}

/* Optimize animations for Safari */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Componentes específicos */
.toast {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 50;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-50%) translateY(1rem);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background-color: #374151;
}

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

.toast.info {
    background-color: #3b82f6;
}

/* Modal styles */
.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

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

/* Button states */
button:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

button:disabled:hover {
    transform: none !important;
    background-color: inherit !important;
}

button:disabled:active {
    transform: none !important;
}

/* Classe específica para botão desabilitado */
.button-disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
    transform: none !important;
}

/* Image grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .toast.success {
        background-color: #4b5563;
    }
}

/* Image description component styles */
.image-description {
    animation: fadeIn 0.3s ease-in;
}

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

.description-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.5;
}

.description-editor textarea {
    resize: vertical;
    min-height: 60px;
}

.description-editor textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Smooth transitions for description states */
.description-content,
.description-error,
.description-editor {
    transition: all 0.2s ease-in-out;
}

/* Loading spinner for pending descriptions */
.description-loading-spinner {
    animation: spin 1s linear infinite;
}

/* Mobile responsiveness for descriptions */
@media (max-width: 640px) {
    .image-description {
        font-size: 0.875rem;
    }
    
    .description-text {
        font-size: 0.875rem;
        line-height: 1.4;
    }
    
    .description-editor textarea {
        font-size: 0.875rem;
        min-height: 80px;
    }
    
    .description-content button,
    .description-error button {
        font-size: 0.75rem;
    }
}

/* Ensure description buttons are touch-friendly on mobile */
@media (max-width: 640px) {
    .description-content button,
    .description-error button {
        min-height: 32px;
        min-width: 32px;
    }
}

/* Dark mode specific adjustments for descriptions */
@media (prefers-color-scheme: dark) {
    .description-editor textarea {
        background-color: #1f2937;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .description-editor textarea:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
}