:root {
    --primary-color: #fe3c72;
    --secondary-color: #ff655b;
    --background-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --gray-text: #777777;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); 
    min-height: 100vh;
}

.site-navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    background-color: #fff;
}

.site-navbar .navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

.btn-primary-custom {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    border-radius: 999px;
    font-weight: 600;
    padding: 8px 18px;
}

.btn-primary-custom:hover {
    color: white;
}

body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 16px 24px;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 350px;
}

.auth-container h1 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.auth-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

.auth-link {
    display: block;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--gray-text);
}

body.app-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 86px 16px 24px;
    overflow: auto;
}

.app-container {
    width: 100%;
    max-width: 460px;
    height: calc(100vh - 110px);
    max-height: 860px;
    background-color: var(--background-color);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.app-header {
    padding: 14px 14px 0;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 10;
    position: relative;
}

.app-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.logo {
    font-weight: 600;
    font-size: 1.35rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-logout-btn {
    color: var(--primary-color);
    font-weight: 600;
    border: 1px solid #ffd2dd;
    background: #fff;
}

.header-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--gray-text);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.view-container {
    display: none;
    flex: 1;
    overflow: hidden;
}

.view-container.active {
    display: flex;
    flex-direction: column;
}

.card-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    min-height: 320px;
}

.card {
    position: absolute;
    width: 90%;
    height: 90%;
    max-height: 500px;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: grab;
}

.card img {
    width: 100%;
    height: 75%;
    object-fit: cover;
    pointer-events: none;
}

.card-content {
    padding: 15px;
}

.card-content h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.card-content p {
    color: var(--gray-text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.controls {
    min-height: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    background: white;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
}

.control-btn:active {
    transform: scale(0.95);
}

.pass {
    background-color: white;
    color: #ec5e6f;
    border: 2px solid #ec5e6f;
}

.like {
    background-color: white;
    color: #4caf50;
    border: 2px solid #4caf50;
}

.pass:hover {
    background-color: #ec5e6f;
    color: white;
}

.like:hover {
    background-color: #4caf50;
    color: white;
}

/* Swipe Animations */
.swipe-left {
    transform: translateX(-200%) rotate(-30deg) !important;
    opacity: 0;
}

.swipe-right {
    transform: translateX(200%) rotate(30deg) !important;
    opacity: 0;
}

.loading {
    color: var(--gray-text);
    font-size: 1.2rem;
}

.no-more {
    text-align: center;
    color: var(--gray-text);
}

.error {
    text-align: center;
    color: #b42318;
    font-weight: 600;
}

/* Matches View */
.matches-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.match-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.match-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.match-info {
    flex: 1;
}

.match-info h5 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.match-info p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    color: var(--gray-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-btn {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-btn:hover {
    background-color: var(--secondary-color);
}

/* Profile View */
#profile-view {
    overflow-y: auto;
}

.profile-form {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-form h4 {
    margin: 0;
    color: var(--text-color);
}

.profile-help {
    margin: 0 0 8px;
    color: var(--gray-text);
    font-size: 0.9rem;
}

.profile-label {
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
}

.profile-photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffd2dd;
    display: none;
}

.profile-save-btn {
    margin-top: 8px;
    border: none;
    background-color: var(--primary-color);
    border-radius: 999px;
    font-weight: 600;
}

.status-chip {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6a1b2e;
    background: #ffdbe6;
}

/* Chat View */
#chat-view {
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h5 {
    margin: 0;
    flex: 1;
    text-align: center;
}

#back-to-matches {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--background-color);
}

.message {
    margin-bottom: 15px;
    max-width: 70%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    margin-left: auto;
}

.message.received {
    margin-right: auto;
}

.message-content {
    background: white;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: var(--primary-color);
    color: white;
}

.message-time {
    font-size: 0.7rem;
    color: var(--gray-text);
    margin-top: 5px;
    text-align: right;
}

.message.received .message-time {
    text-align: left;
}

.no-messages {
    text-align: center;
    color: var(--gray-text);
    margin-top: 50px;
}

.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 10px 15px;
    outline: none;
}

.chat-input input:focus {
    border-color: var(--primary-color);
}

#send-btn {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

#send-btn:hover {
    background-color: var(--secondary-color);
}

/* Match Modal */
.modal-content {
    border-radius: 20px;
    padding: 20px;
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.modal-content .btn {
    margin: 5px;
}

@media (max-width: 576px) {
    body.app-page {
        padding: 78px 8px 12px;
    }

    .app-container {
        height: calc(100vh - 92px);
        border-radius: 14px;
    }
}
