.gradient-bg {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}
.sidebar {
    transition: all 0.3s;
}
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-state {
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
}
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.photo-thumbnail {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin: 0.25rem;
}
.corretor-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}
.section-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.document-preview {
    max-width: 100%;
    height: 200px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        height: 100vh;
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .sidebar.active + .mobile-menu-overlay {
        display: block;
    }
    .photo-thumbnail {
        width: 100px;
        height: 100px;
    }
    .gallery-main-image {
        height: 300px;
    }
    .gallery-thumb {
        width: 70px;
        height: 50px;
    }
    .detail-label {
        min-width: 120px;
    }
}

/* Layout improvements */
html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
}
.content-wrapper {
    flex: 1;
}
footer {
    flex-shrink: 0;
}

/* Terreno card styles */
.terreno-card {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}
.terreno-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Melhorias no card de terreno */
.terreno-card {
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.terreno-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.terreno-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.terreno-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.terreno-detail {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
    color: #4b5563;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.terreno-detail i {
    width: 1.5rem;
    color: #3b82f6;
    margin-right: 0.5rem;
}

/* Add these styles to ensure 16:9 aspect ratio for terreno photos */
.terreno-photo-container {
    width: 100%;
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio (9 / 16 = 0.5625 or 56.25%) */
    overflow: hidden;
}

.terreno-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures the image covers the container while maintaining aspect ratio */
}

/* For empty state placeholders */
.terreno-photo.bg-gray-200 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para os cards de terrenos na página inicial */
.terreno-home-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.terreno-home-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.terreno-home-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.terreno-home-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.75rem;
}

.terreno-home-detail {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #4a5568;
}

.terreno-home-detail i {
    width: 1.5rem;
    margin-right: 0.5rem;
    color: #3182ce;
}

.terreno-home-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}

/* Melhorias na visualização de terrenos */
.terreno-info {
    padding: 1.25rem;
}

.terreno-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.terreno-detail {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem;
    color: #4a5568;
    font-size: 0.95rem;
}

.terreno-detail i {
    width: 1.5rem;
    color: #4299e1;
    margin-right: 0.5rem;
}

/* Melhorias para o botão de excluir foto */
.delete-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    border: none;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.delete-photo-btn:hover {
    background-color: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

/* Galeria no modal de detalhes */
.terreno-gallery {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background-color: #f9fafb;
}
.gallery-main-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.gallery-thumbs {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    background-color: white;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}
.gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}
.gallery-thumbs::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.gallery-thumbs::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}
.gallery-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}
.gallery-thumb:hover {
    opacity: 1;
}
.gallery-thumb.active {
    border-color: #3b82f6;
    opacity: 1;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.terreno-gallery-empty {
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

/* Estilos para a galeria de fotos na visualização de terreno */
.terreno-galeria {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #f7fafc;
}

.terreno-galeria img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.galeria-foto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.galeria-foto.active {
    opacity: 1;
}

.galeria-indicador {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 4px;
    cursor: pointer;
}

.galeria-indicador.active {
    background-color: white;
    transform: scale(1.2);
}

/* Overlay de carregamento */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
}
.loading-card {
    background-color: white;
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-align: center;
    max-width: 90%;
    width: 300px;
}
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

/* Estilo para mensagens de erro */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Melhoria na visualização em dispositivos móveis */
@media (max-width: 768px) {
    .gallery-main-image {
        height: 300px;
    }
    .gallery-thumb {
        width: 70px;
        height: 50px;
    }
    .detail-label {
        min-width: 120px;
    }
    .max-h-90vh {
        max-height: 85vh;
    }
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Photos preview grid */
#fotosPreview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

/* Fix for absolute positioned elements inside relative containers */
.relative {
    position: relative !important;
}

/* Notification system */
.notification {
    transition: opacity 0.3s ease;
}

/* Detail layout for terreno view */
.detail-item {
    display: flex;
    margin-bottom: 0.5rem;
}
.detail-label {
    font-weight: 500;
    min-width: 160px;
    color: #4b5563;
}
.detail-value {
    color: #1f2937;
    flex: 1;
}

/* Improved cards for recent terrenos */
.recent-terreno-card {
    transition: all 0.2s ease;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
}
.recent-terreno-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Document cards in terreno view */
.document-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.2s;
}
.document-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Validation styles */
.input-error {
    border-color: #ef4444 !important;
}
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Estilos para cards de documentos na visualização */
.documento-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-align: center;
}

.documento-card:hover {
    background-color: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.documento-card i {
    font-size: 2rem;
    color: #e53e3e;
    margin-bottom: 0.5rem;
}

.documento-card span {
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 500;
}

.documento-card button {
    margin-top: 0.5rem;
    color: #4299e1;
    font-size: 0.85rem;
}

.documento-card button:hover {
    color: #2b6cb0;
}

/* Estilos para paginação */
#paginationControls button {
    transition: all 0.2s ease;
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#paginationControls button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}
