/* Main stylesheet for Flared Dating App */
/* File: css/styles.css */

:root {
    --primary-color: #ff4458;
    --secondary-color: #ff6b6b;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --input-background: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-content p {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
}

/* Message Loading Indicator */
.message-loading {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: var(--text-color);
    font-size: 14px;
}

.message-loading.show {
    display: flex;
}

.message-loading .mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-box {
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.register-box {
    max-width: 600px;
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.logo-section h1 {
    font-size: 36px;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.tagline {
    color: #666;
    font-size: 16px;
}

/* Forms */
.auth-form {
    margin-top: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--input-background);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 68, 88, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #e63946;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 88, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn i {
    margin-right: 8px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
}

.alert i {
    margin-right: 10px;
    margin-top: 2px;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 25px;
    color: #666;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Features Preview */
.features-preview {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.features-preview h3 {
    text-align: center;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.feature-list {
    display: grid;
    gap: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    color: #666;
}

.feature-item i {
    width: 24px;
    color: var(--primary-color);
    margin-right: 12px;
}

/* Dashboard */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--card-background);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
}

.header-logo i {
    font-size: 28px;
    color: var(--primary-color);
    margin-right: 10px;
}

.header-logo h1 {
    font-size: 24px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: nowrap;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link i {
    font-size: 20px;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Swipe Cards */
.swipe-container {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    height: 600px;
}

.swipe-card {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.swipe-card.active-card {
    z-index: 10;
}

.swipe-card.dragging {
    transition: none;
    cursor: grabbing;
}

.swipe-card-image {
    width: 100%;
    height: 70%;
    object-fit: cover;
}

.swipe-card-info {
    padding: 20px;
    height: 30%;
}

.swipe-card-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-color);
}

.swipe-card-details {
    color: #666;
    font-size: 16px;
}

.swipe-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.swipe-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.swipe-btn:hover {
    transform: scale(1.1);
}

.swipe-btn.dislike {
    background: #f5f5f5;
    color: var(--danger-color);
}

.swipe-btn.like {
    background: #f5f5f5;
    color: var(--success-color);
}

.swipe-btn.superlike {
    background: #f5f5f5;
    color: #3498db;
}

.swipe-btn i {
    font-size: 24px;
}

/* Matches Grid */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.match-card {
    background: var(--card-background);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.match-card:hover {
    transform: translateY(-5px);
}

.match-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.match-card-info {
    padding: 15px;
}

.match-card-name {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.match-card-status {
    color: #666;
    font-size: 14px;
}

.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    margin-right: 5px;
}

/* Chat */
.chat-container {
    display: flex;
    height: calc(100vh - 80px);
    background: var(--card-background);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    background: var(--card-background);
}

.chat-list {
    list-style: none;
}

.chat-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
}

.chat-item:hover,
.chat-item.active {
    background: #f5f5f5;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-color);
}

.chat-last-message {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    background: var(--card-background);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f9f9f9;
}

.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
}

.message.received {
    align-self: flex-start;
    background: var(--card-background);
    color: var(--text-color);
}

.message-time {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: var(--card-background);
}

.chat-input input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 16px;
    background: var(--input-background);
    color: var(--text-color);
}

.chat-input button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

.chat-input button:hover {
    background: #e63946;
}

/* DoubleDate */
.doubledate-container {
    max-width: 800px;
    margin: 0 auto;
}

.doubledate-header {
    text-align: center;
    margin-bottom: 40px;
}

.doubledate-header h2 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.doubledate-header p {
    color: #666;
    font-size: 18px;
}

.group-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.group-members {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.member-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 15px;
}

.member-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.member-info h4 {
    margin-bottom: 5px;
    color: var(--text-color);
}

.member-status {
    font-size: 14px;
    color: #666;
}

.ready-status {
    color: var(--success-color);
    font-weight: bold;
}

.group-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Profile */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    background: var(--card-background);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    object-fit: cover;
    border: 5px solid var(--primary-color);
}

.profile-name {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.profile-bio {
    color: #666;
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.profile-photos {
    background: var(--card-background);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-item {
    position: relative;
    padding-bottom: 100%;
    border-radius: 15px;
    overflow: hidden;
}

.photo-item img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.add-photo {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-photo:hover {
    background: #e0e0e0;
}

.add-photo i {
    font-size: 48px;
    color: #999;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Swipe Counter */
.swipe-counter {
    background: var(--card-background);
    padding: 8px 16px;
    border-radius: 25px;
    box-shadow: var(--shadow);
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.swipe-counter i {
    color: var(--primary-color);
    margin-right: 5px;
}

.swipe-counter.low-swipes {
    background: #fff3cd;
    color: #856404;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-background);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    color: var(--text-color);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 999;
    animation: confetti-fall 5s linear;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Banned User Indicator */
.user-banned {
    display: inline-block;
    background: var(--danger-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

/* Swipe Indicators */
.like-indicator,
.dislike-indicator {
    position: absolute;
    top: 50px;
    font-size: 48px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.like-indicator {
    right: 20px;
    color: var(--success-color);
    border: 3px solid var(--success-color);
    transform: rotate(15deg);
}

.dislike-indicator {
    left: 20px;
    color: var(--danger-color);
    border: 3px solid var(--danger-color);
    transform: rotate(-15deg);
}

/* --- Responsive Ad Container Fix --- */
.ad-container {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin: 20px auto;
    max-width: 320px; /* Keep ads within this width */
    overflow: hidden; /* Prevent overflow */
}

.ad-container iframe,
.ad-container div {
    display: block;
    max-width: 100% !important;
    width: 100% !important;
    height: auto;
}

/* Prevent entire page from scrolling horizontally */
body {
    overflow-x: hidden;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-background);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    color: var(--text-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

/* Dark Mode Styles */
.dark-mode {
    --background-color: #0a0a0a;
    --card-background: #1a1a1a;
    --input-background: #2a2a2a;
    --text-color: #e0e0e0;
    --dark-color: #ffffff;
    --border-color: #333;
    --shadow: 0 2px 10px rgba(255,255,255,0.1);
    --shadow-lg: 0 10px 30px rgba(255,255,255,0.15);
}

.dark-mode .loading-overlay {
    background: rgba(26, 26, 26, 0.9);
}

.dark-mode .chat-messages {
    background: #161616;
}

.dark-mode .chat-item:hover,
.dark-mode .chat-item.active {
    background: #2a2a2a;
}

.dark-mode .member-card {
    background: #2a2a2a;
}

.dark-mode .ad-container {
    background: #2a2a2a;
}

.dark-mode .swipe-counter.low-swipes {
    background: #5d4e37;
    color: #deb887;
}

.dark-mode .add-photo {
    background: #2a2a2a;
}

.dark-mode .add-photo:hover {
    background: #333;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header-nav {
        gap: 10px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: 8px;
    }
    
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .swipe-container {
        height: 500px;
    }
    
    .matches-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .group-members {
        grid-template-columns: 1fr;
    }
    
    .profile-stats {
        gap: 20px;
    }
    
    .swipe-counter {
        font-size: 12px;
        padding: 6px 12px;
    }

    .dark-mode-toggle {
        bottom: 80px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

.verification-badge-card {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.verification-badge-card i {
    font-size: 12px;
}

/* For match cards in grid */
.match-card {
    position: relative;
}

.match-card .verification-badge-card {
    top: 10px;
    left: 10px;
    font-size: 11px;
    padding: 3px 6px;
}

/* For swipe cards */
.swipe-card {
    position: relative;
}

.swipe-card .verification-badge-card {
    top: 20px;
    left: 20px;
}

/* Verified user indicator in chat */
.chat-name .verified-icon {
    color: #4caf50;
    font-size: 14px;
    margin-left: 5px;
}

/* Dark mode adjustments */
.dark-mode .verification-badge-card {
    background: rgba(76, 175, 80, 0.8);
}

/* Animation for verification badge */
.verification-badge-card {
    animation: verificationPulse 2s infinite;
}

@keyframes verificationPulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.9; 
    }
    50% { 
        transform: scale(1.05); 
        opacity: 1; 
    }
}

