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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Landing Page */
.landing-container {
    text-align: center;
    color: white;
}

.landing-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.landing-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.launch-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.launch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    width: 90%;
    height: 90%;
    max-width: 600px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* MODAL CLOSE BUTTON (X) - TOP RIGHT */
.modal-close {
    position: fixed;
    top: 5%;
    right: 5%;
    background: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
    z-index: 2001;
}

.modal-close:hover {
    color: #333;
    border-color: #999;
    background: #f5f5f5;
}

#app-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Auth Styles */
.auth-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
}

.auth-form {
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* TERMS OF SERVICE BOX - SCROLLABLE */
.terms-box {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    height: 60px;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.4;
    color: #666;
    margin-bottom: 15px;
}

.terms-box::-webkit-scrollbar {
    width: 6px;
}

.terms-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.terms-box::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 8px;
}

.terms-box::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* TERMS CHECKBOX */
.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    font-size: 14px;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.error {
    background: #fee;
    color: #c33;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Discover Styles */
.discover-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

.discover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.discover-header h2 {
    color: #333;
    flex: 1;
}

.discover-header button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    background: #f0f0f0;
    color: #333;
}

.discover-header button:hover {
    background: #e0e0e0;
}

.cards-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.card {
    position: absolute;
    width: 280px;
    height: 400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.1s ease, opacity 0.1s ease;
    display: flex;
    flex-direction: column;
}

.card.swiping {
    cursor: grabbing;
}

/* PICTURES CONTAINER - SHOWS ALL PICTURES */
.pictures-container {
    width: 100%;
    height: 70%;
    overflow-y: auto;
    background: #f0f0f0;
}

.pictures-container img {
    width: 100%;
    height: auto;
    display: block;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f0f0f0;
}

.card-info {
    padding: 1rem;
    height: 30%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-info h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.card-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.no-more-users {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.action-btn.skip {
    background: #f0f0f0;
    color: #999;
}

.action-btn.skip:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.action-btn.like {
    background: #ff6b6b;
    color: white;
}

.action-btn.like:hover {
    background: #ee5a55;
    transform: scale(1.1);
}

.match-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.match-notification h2 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

.match-notification p {
    color: #666;
    margin-bottom: 1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Matches Styles */
.matches-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.matches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.matches-header h2 {
    color: #333;
    flex: 1;
}

.matches-header button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #f0f0f0;
}

.matches-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-item {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
}

.match-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.match-avatar {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    background: #e0e0e0;
}

.match-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.match-info h3 {
    margin: 0;
    color: #333;
}

.match-info p {
    margin: 0;
    color: #999;
    font-size: 0.9rem;
}

.no-matches {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* Match Detail Styles */
.match-detail-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.match-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.match-detail-header button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #f0f0f0;
    font-size: 0.9rem;
}

.match-detail-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
}

.match-detail-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    background: #e0e0e0;
}

.match-detail-images img:first-child {
    grid-column: span 2;
    height: 200px;
}

.match-detail-info {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.match-detail-info h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.match-detail-info p {
    color: #666;
    margin: 0;
    word-wrap: break-word;
}

.match-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.match-detail-actions button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-message {
    background: #667eea;
    color: white;
}

.btn-profile {
    background: #f0f0f0;
    color: #333;
}

.btn-unmatch {
    background: #fee;
    color: #c33;
}

/* Messages Styles */
.messages-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messages-header h2 {
    color: #333;
    margin: 0;
}

.messages-header button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #f0f0f0;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    margin-bottom: 0.5rem;
}

.message.sent {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 12px;
    border-radius: 12px;
    word-wrap: break-word;
}

.message.sent .message-content {
    background: #667eea;
    color: white;
}

.message.received .message-content {
    background: #f0f0f0;
    color: #333;
}

.messages-input {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.messages-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.messages-input button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Settings Styles */
.settings-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.settings-header h2 {
    color: #333;
    margin: 0;
}

.settings-header button {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: #f0f0f0;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.settings-group {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.settings-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.settings-group input[type="text"],
.settings-group input[type="range"],
.settings-group select,
.settings-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.settings-group textarea {
    resize: vertical;
    min-height: 80px;
}

.range-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.range-value {
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
    flex: 1;
}

/* ADD PICTURES BUTTON */
.btn-add-pictures {
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background-color: #34C759;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.btn-add-pictures:hover {
    background-color: #28A745;
}

.settings-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.settings-buttons button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-save {
    background: #667eea;
    color: white;
}

.btn-logout {
    background: #FF3B30;
    color: white;
}

.btn-logout:hover {
    background: #CC2D26;
}

/* Responsive */
@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
    }

    .card {
        width: 85vw;
        height: 70vh;
    }

    .match-detail-images {
        grid-template-columns: 1fr;
    }

    .match-detail-images img:first-child {
        grid-column: auto;
    }

    .message-content {
        max-width: 85%;
    }
}