:root {
    --primary: #e91e63;
    --primary-dark: #c2185b;
    --primary-light: #f8bbd0;
    --secondary: #ff4081;
    --accent: #ff80ab;
    --background: #fafafa;
    --surface: #ffffff;
    --text: #212121;
    --text-light: #757575;
    --text-muted: #9e9e9e;
    --error: #d32f2f;
    --success: #388e3c;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #e91e63 0%, #ff4081 100%);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    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);
    background: var(--background);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-header {
    background: var(--surface);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.logo span {
    color: var(--primary);
}

.main-nav, .auth-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a {
    color: var(--text);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.main-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-logout {
    color: var(--error) !important;
}

.btn-primary {
    background: var(--gradient);
    color: white !important;
    padding: 10px 24px;
    border-radius: var(--radius);
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.btn-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
    padding: 8px 20px;
    border-radius: var(--radius);
    display: inline-block;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.main-content {
    min-height: calc(100vh - 140px);
    padding: 40px 0;
}

.main-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 30px 0;
    text-align: center;
}

.main-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-nav {
    display: flex;
    gap: 20px;
}

.alert {
    padding: 16px 24px;
    border-radius: var(--radius);
    margin: 20px auto;
    max-width: 600px;
}

.alert-error {
    background: #ffebee;
    color: var(--error);
    border-left: 4px solid var(--error);
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
    border-left: 4px solid var(--success);
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 40px 20px;
}

.auth-container {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px var(--shadow);
    width: 100%;
    max-width: 440px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-light);
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.auth-form input,
.auth-form textarea,
.auth-form select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-light);
}

.auth-footer a {
    font-weight: 600;
}

.dashboard-page {
    padding: 20px 0;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 20px var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;
}

.card-link {
    color: var(--primary);
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.match-list, .message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-item, .message-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.match-item:hover, .message-item:hover {
    background: var(--primary-light);
}

.match-avatar, .message-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.match-avatar img, .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.photo-placeholder.large {
    width: 200px;
    height: 200px;
    font-size: 64px;
}

.match-info, .message-info {
    flex: 1;
}

.match-name, .message-name {
    display: block;
    font-weight: 600;
    font-size: 16px;
}

.match-date, .message-preview {
    color: var(--text-light);
    font-size: 14px;
}

.card-actions {
    grid-column: 1 / -1;
}

.card-actions h2 {
    margin-bottom: 20px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: var(--background);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.action-icon {
    font-size: 32px;
    color: var(--primary);
}

.profile-page {
    padding: 20px 0;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.profile-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
    max-width: 600px;
}

.profile-photo {
    width: 100%;
    height: 300px;
    background: var(--background);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    padding: 24px;
}

.profile-info h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.profile-age, .profile-city {
    color: var(--text-light);
    margin-bottom: 4px;
}

.profile-bio, .profile-interests {
    padding: 24px;
    border-top: 1px solid var(--border);
}

.profile-bio h3, .profile-interests h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-light);
}

.interests-tag {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.profile-edit-page {
    padding: 20px 0;
}

.profile-form {
    max-width: 600px;
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.photo-upload {
    padding: 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.photo-preview {
    margin-top: 16px;
}

.photo-preview img {
    max-width: 200px;
    border-radius: var(--radius);
}

.browse-page {
    padding: 20px 0;
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 40px 0;
}

.profile-card {
    width: 300px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px var(--shadow);
    overflow: hidden;
}

.card-photo {
    width: 100%;
    height: 400px;
    background: var(--background);
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 24px;
}

.card-info h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.card-age, .card-city {
    color: var(--text-light);
}

.card-bio {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 14px;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.btn-dislike, .btn-like {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-dislike {
    background: var(--surface);
    color: var(--error);
    border: 2px solid var(--error);
}

.btn-dislike:hover {
    background: var(--error);
    color: white;
}

.btn-like {
    background: var(--gradient);
    color: white;
}

.btn-like:hover {
    transform: scale(1.1);
}

.matches-page, .messages-page {
    padding: 20px 0;
}

.match-grid, .message-threads {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.match-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    display: block;
}

.match-card:hover {
    transform: translateY(-4px);
}

.match-photo {
    width: 100%;
    height: 200px;
}

.match-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.match-info {
    padding: 16px;
}

.match-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.match-date {
    color: var(--text-light);
    font-size: 14px;
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.thread-item:hover {
    background: var(--primary-light);
}

.thread-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.thread-info {
    flex: 1;
}

.thread-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.thread-info p {
    color: var(--text-light);
    font-size: 14px;
}

.thread-time {
    color: var(--text-light);
    font-size: 14px;
}

.chat-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 2px 10px var(--shadow);
}

.back-btn {
    font-size: 24px;
    padding: 8px 16px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 70%;
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-content {
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 2px 10px var(--shadow);
}

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

.message-time {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.7;
}

.chat-form {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 -2px 10px var(--shadow);
}

.chat-form input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
}

.search-page {
    padding: 20px 0;
}

.search-form {
    max-width: 600px;
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 40px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.result-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
}

.result-photo {
    width: 100%;
    height: 200px;
}

.result-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    padding: 20px;
}

.result-info h3 {
    margin-bottom: 8px;
}

.admin-page {
    padding: 20px 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--shadow);
    text-align: center;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .main-nav, .auth-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .cards-container {
        padding: 20px 0;
    }
    
    .profile-card {
        width: 100%;
    }
    
    .chat-page {
        height: calc(100vh - 70px);
    }
    
    .main-footer .container {
        flex-direction: column;
        gap: 16px;
    }
}