* {
    box-sizing: border-box;
}

:root {
    --primary-color: #fe3c72;
    /* Tinder Pink */
    --secondary-color: #ff655b;
    /* Tinder Orange */
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333;
    --gradient-bg: linear-gradient(45deg, #fd267a, #ff6036);
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body.tinder-page {
    background: #222;
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.tinder-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

@media (min-width: 501px) {
    body.tinder-page {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .tinder-container {
        position: relative;
        width: 100%;
        max-width: 500px;
        height: 90vh;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
        margin: auto;
    }
}

/* Header */
/* Header Moderno */
.header {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo i {
    font-size: 2rem;
    background: var(--gradient-bg);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-logo h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-bg);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Actions */
.actions {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    background: #fff;
}

/* Generic Buttons */
.btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #fff;
    /* Sombra mais pronunciada e visível (camada dupla) */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.15);
    will-change: transform;
}

.btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: scale(0.9);
}

.btn-dislike {
    color: #ff4458;
    background: #fff;
    font-size: 1.8rem;
}

.btn-dislike:hover {
    background-color: #fff;
    color: #ff4458;
    box-shadow: 0 10px 25px rgba(255, 68, 88, 0.4);
}

.btn-like {
    color: #1be4a1;
    background: #fff;
    width: 65px;
    height: 65px;
    font-size: 2.2rem;
}

.btn-like:hover {
    background-color: #fff;
    color: #1be4a1;
    box-shadow: 0 12px 30px rgba(27, 228, 161, 0.45);
}

.btn-info {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    color: #4a90e2;
}

.btn-info:hover {
    background-color: #fff;
    color: #4a90e2;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

.btn-filter-small {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    background: var(--gradient-bg);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(253, 38, 122, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-filter-small:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(253, 38, 122, 0.4);
}

.btn-filter-small:active {
    transform: scale(0.9);
}

.btn-small {
    width: auto;
    height: auto;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 75, 43, 0.4);
}

.btn-secondary {
    background: #fff;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 5px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Botão com largura automática */
.btn-auto-width {
    width: auto !important;
    display: inline-block !important;
}

/* Messages */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #c33;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #3c3;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: -5px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.btn-back-home {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-back-home:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
    text-decoration: none;
}

/* Header Actions & Nav */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-greeting {
    font-size: 0.9rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-greeting strong {
    color: var(--primary-color);
}

.user-greeting-text {
    display: flex;
    flex-direction: column;
}

.edit-profile-link {
    font-size: 0.75rem;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.edit-profile-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.action-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    position: relative;
    font-size: 1.4rem;
    color: #666;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff3b30;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-btn-primary {
    background: var(--gradient-bg);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(253, 38, 122, 0.2);
}

.header-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(253, 38, 122, 0.3);
}

/* Profile Shortcuts Bar (Bottom) */
.profile-shortcuts-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: auto;
    /* Pushes it to the bottom of the flex container */
    z-index: 100;
}

.user-info-brief {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.user-info-brief:hover {
    transform: translateX(5px);
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-text-brief {
    display: flex;
    flex-direction: column;
}

.welcome-text {
    font-size: 0.9rem;
    color: #333;
}

.welcome-text strong {
    color: var(--primary-color);
}

.edit-text {
    font-size: 0.75rem;
    color: #888;
}

.btn-shortcut-primary {
    background: var(--gradient-bg);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(253, 38, 122, 0.3);
}

.btn-shortcut-primary:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 38, 122, 0.4);
}

.btn-shortcut-primary i {
    font-size: 1rem;
}

.btn-shortcut-secondary {
    background: #f0f2f5;
    color: #444;
    border: 1px solid #ddd;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-shortcut-secondary:hover {
    background: #e4e6eb;
    border-color: #ccc;
    transform: translateY(-1px);
}

.btn-shortcut-secondary i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.header-btn-primary i {
    font-size: 1rem;
}

.logout-btn {
    color: #999;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: #333;
}

/* Auth Buttons Simple */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-login-simple {
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.btn-login-simple:hover {
    color: var(--primary-color);
}

.btn-register-main {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(254, 60, 114, 0.3);
}

.btn-register-main:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 60, 114, 0.4);
}

/* Generic Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    /* Increased to be above everything except SweetAlert and Photo Modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

/* Ensure SweetAlert2 is above all modals */
.swal2-container {
    z-index: 11000 !important;
}

/* Forçar notificações a ficarem DENTRO do container do app no desktop */
.tinder-container .swal2-container {
    position: absolute !important;
}

.tinder-container .swal2-popup.swal2-toast {
    margin: 10px;
    font-size: 0.9rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 20px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    /* Fundamental para o arredondamento perfeito */
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Style for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 20px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 20px;
    border: 2px solid #fff;
    /* Cria um "espaço" ao redor do thumb */
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--primary-color);
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fly-left {
    0% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-150%) rotate(-30deg);
        opacity: 0;
    }
}

@keyframes fly-right {
    0% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateX(150%) rotate(30deg);
        opacity: 0;
    }
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.swiping-left {
    animation: fly-left 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
    pointer-events: none;
}

.swiping-right {
    animation: fly-right 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite linear;
}

/* Responsividade Geral */
@media (max-width: 480px) {
    .header {
        padding: 10px;
    }

    .user-info {
        font-size: 0.8rem;
    }
}

/* Fix Z-Index for Nested Modals */
#pet-info-modal {
    z-index: 3010 !important;
}