/* ========================================
   PET STYLES
   Pet card, photos, info, registration, camera
   ======================================== */

/* Pet Info Modal */
#pet-info-modal {
    z-index: 4000;
    /* Higher than other modals (3000) */
}

#pet-info-card-inner {
    width: 100% !important;
    border-radius: 20px;
    background: white;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.pet-details-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.pet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.tag {
    background: #fdf2f8;
    color: #e91e63;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.pet-bio-section,
.owner-info-section {
    margin-top: 20px;
}

.pet-bio-section h3,
.owner-info-section h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
}

.pet-bio-section p,
.owner-info-section p {
    color: #666;
    line-height: 1.5;
}

.owner-info-section p {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-photo-container {
    height: 400px !important;
    min-height: 300px;
}

.info-photo-click-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 45%;
    z-index: 5;
    cursor: pointer;
}

.info-photo-click-area.left {
    left: 0;
}

.info-photo-click-area.right {
    right: 0;
}

.photo-nav-btn {
    display: none !important;
}

/* Photo Controls & Camera */
.photo-controls {
    display: flex;
    gap: 10px;
}

.camera-preview-wrapper {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-actions {
    display: flex;
    gap: 10px;
}

/* Pet Card */
.pet-card {
    flex: 1;
    position: relative;
    margin: 10px;
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.pet-photo-container {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.pet-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.photo-overlay {
    display: none;
}

.pet-info {
    padding: 15px 20px;
    background: #fff;
    color: #333;
    flex-shrink: 0;
}

.pet-info h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
}

.pet-info p {
    margin: 4px 0 0;
    font-size: 1rem;
    color: #888;
}

.photo-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
    padding: 0 4px;
}

.photo-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(2px);
}

.photo-bar.active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Preview de fotos */
.photos-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    max-width: 100%;
}

.photo-preview-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: visible;
    background: #f5f5f5;
    width: 100px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-preview-item:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.photo-preview-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.photo-preview-item span {
    display: block;
    text-align: center;
    padding: 1px;
    font-size: 0.6rem;
    color: #666;
    background: white;
    line-height: 1.1;
}

.photo-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ff4444;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.photo-remove-btn:hover {
    background-color: #cc0000;
    transform: scale(1.1);
}

.photo-remove-btn:active {
    transform: scale(0.95);
}

.photo-remove-btn i {
    font-size: 10px;
}

/* Modal para visualizar foto */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.photo-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.photo-modal-close:hover {
    color: var(--primary-color);
}

/* Garante que o fechar apareça sobre a foto do pet */
#pet-info-modal .modal-close {
    color: white;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.2);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    top: 10px;
    right: 10px;
}

/* Campos dinâmicos */
#breed-custom-group {
    animation: fadeIn 0.3s ease-in;
}

/* Responsividade Pet */
@media (max-width: 480px) {
    .photo-preview-item {
        width: 35px;
    }

    .photo-preview-item img {
        width: 35px;
        height: 35px;
    }

    .photo-modal-close {
        top: -30px;
        font-size: 30px;
    }
}

/* No Pets Notice */
.no-pets-notice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 20px;
    z-index: 20;
}

.notice-content i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.2);
    display: block;
}

.notice-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.notice-content p {
    font-size: 1rem;
    opacity: 0.7;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}