* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ÜLDINE */

body.page {
    min-height: 100vh;
    background: #020617;
    color: #e5e7eb;
    padding-top: 72px;
}

a {
    color: #7dd3fc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* TOPBAR */

.topbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.logo {
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f97316;
}

.topbar-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.topbar-hello {
    font-size: 13px;
    color: #e5e7eb;
}

/* KONTEINER */

.center-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* NUPUD */

button,
.btn-primary,
.btn-secondary,
.btn-swipe {
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #fb7185);
    color: #0b1120;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    transition: 0.15s ease;
    box-shadow: 0 8px 18px rgba(248, 113, 113, 0.35);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(248, 113, 113, 0.45);
}

.btn-secondary {
    background: transparent;
    border: 1px solid #f97316;
    color: #f97316;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 15px;
}

.btn-secondary:hover {
    background: rgba(249, 115, 22, 0.18);
}

.btn-primary.full,
.btn-secondary.full {
    width: 100%;
}

/* KAARDID */

.card {
    background: rgba(15, 23, 42, 0.88);
    border-radius: 22px;
    padding: 20px 18px 24px;
    box-shadow: 0 22px 50px rgba(0,0,0,0.75);
    border: 1px solid rgba(148, 163, 184, 0.6);
    max-width: 520px;
    margin: 20px auto 0;
}

.card h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* AUTH */

.auth-wrapper {
    max-width: 420px;
    margin: 70px auto;
    background: rgba(15, 23, 42, .9);
    border-radius: 22px;
    padding: 22px 18px 24px;
    border: 1px solid rgba(148, 163, 184, .6);
    box-shadow: 0 20px 50px rgba(0,0,0,.65);
}

.auth-wrapper h1 {
    margin-bottom: 16px;
    font-size: 24px;
    text-align: center;
}

.auth-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
    color: #e5e7eb;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
    margin-top: 3px;
    padding: 9px 11px;
    border-radius: 11px;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background: rgba(15, 23, 42, 0.96);
    color: #f9fafb;
    font-size: 14px;
}

.auth-alt {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

/* FLASH */

.flash {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 6px;
}

.flash-success {
    background: rgba(22, 163, 74, 0.18);
    border: 1px solid rgba(22, 163, 74, 0.8);
    color: #bbf7d0;
}

.flash-error {
    background: rgba(220, 38, 38, 0.18);
    border: 1px solid rgba(220, 38, 38, 0.85);
    color: #fecaca;
}

/* SWIPE */

.card-photo {
    width: 100%;
    height: 360px;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #020617;
}

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

.swipe-actions {
    display: flex;
    gap: 14px;
    margin-top: 14px;
}

.btn-swipe {
    flex: 1;
    padding: 11px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
}

.btn-like {
    background: #22c55e;
    color: #022c22;
}

.btn-pass {
    background: #111827;
    color: #f9fafb;
}

.thumb-row {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.thumb-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

.empty-state {
    text-align: center;
    padding: 20px;
}

.muted {
    color: #9ca3af;
}

.small {
    font-size: 12px;
}

/* PROFIIL */

.profile-layout {
    max-width: 980px;
    margin: 40px auto;
    padding: 28px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.profile-photo-block {
    flex: 0 0 380px;
}

.profile-form-block {
    flex: 1;
}

.profile-photo-block h1 {
    margin-bottom: 10px;
    font-size: 26px;
}

.profile-photo-block h2,
.profile-form-block h2 {
    margin: 6px 0 10px;
    font-size: 20px;
}

.profile-photo {
    width: 100%;
    height: 260px;
    border-radius: 18px;
    overflow: hidden;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

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

.photo-empty-text {
    color: #6b7280;
    font-size: 14px;
}

.photo-upload-form {
    margin-top: 4px;
    margin-bottom: 8px;
}

.file-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 13px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px dashed #4b5563;
    cursor: pointer;
    color: #e5e7eb;
}

.file-label input[type="file"] {
    display: none;
}

/* FOTO GALERII */

.gallery-title {
    margin-top: 14px;
    margin-bottom: 6px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.photo-item {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #111827;
    height: 130px;
}

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

.photo-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    color: #0b1120;
}

.photo-badge.primary {
    background: #facc15;
}

.photo-actions {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    display: flex;
    gap: 6px;
}

.photo-btn {
    flex: 1;
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    font-size: 11px;
    padding: 3px 4px;
    border-radius: 8px;
    text-align: center;
}

.photo-btn.danger {
    background: rgba(220, 38, 38, 0.85);
}

/* CHAT */

.chat-layout {
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.chat-sidebar {
    flex: 0 0 260px;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 20px;
    padding: 12px 10px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.chat-main {
    flex: 1;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
}

.chat-match-list {
    list-style: none;
    margin-top: 6px;
}

.chat-match-item {
    border-radius: 12px;
    margin-bottom: 4px;
}

.chat-match-item a {
    display: flex;
    gap: 7px;
    padding: 5px 6px;
    align-items: center;
    color: inherit;
}

.chat-match-item:hover {
    background: rgba(31, 41, 55, 0.9);
}

.chat-match-item.active {
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.7);
}

.chat-match-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.chat-match-info {
    flex: 1;
}

.chat-match-name {
    font-size: 14px;
    font-weight: 600;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

.chat-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #020617;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
}

.chat-header-name {
    font-weight: 600;
    font-size: 15px;
}

.chat-messages {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.chat-message.me {
    margin-left: auto;
    align-items: flex-end;
}

.chat-message.them {
    margin-right: auto;
    align-items: flex-start;
}

.chat-bubble {
    padding: 7px 10px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.me .chat-bubble {
    background: #22c55e;
    color: #022c22;
    border-bottom-right-radius: 4px;
}

.chat-message.them .chat-bubble {
    background: #111827;
    color: #e5e7eb;
    border-bottom-left-radius: 4px;
}

.chat-time {
    margin-top: 1px;
    font-size: 11px;
    color: #9ca3af;
}

.chat-system-msg {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.chat-input {
    border-top: 1px solid rgba(55, 65, 81, 0.9);
    padding: 7px 9px;
    display: flex;
    gap: 7px;
    align-items: center;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background: rgba(15, 23, 42, 0.96);
    color: #f9fafb;
    padding: 7px 9px;
    font-size: 14px;
}

.chat-input textarea:focus {
    outline: 1px solid #f97316;
    border-color: #f97316;
}

/* RESPONSIVE */

@media (max-width: 800px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .center-wrapper {
        padding: 18px 10px 30px;
    }

    .profile-layout {
        flex-direction: column;
        padding: 20px;
        gap: 18px;
    }

    .profile-photo-block {
        flex: none;
    }

    .profile-photo {
        height: 220px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .chat-layout {
        flex-direction: column;
    }

    .chat-sidebar {
        max-height: none;
        order: 2;
    }

    .chat-main {
        max-height: none;
        order: 1;
    }
}

.interests-row {
    margin: 8px 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.5);
    font-size: 12px;
    color: #e0f2fe;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-box {
    background: #020617;
    border-radius: 18px;
    padding: 20px;
    max-width: 520px;
    width: 95%;
    border: 1px solid rgba(148, 163, 184, 0.6);
    max-height: 80vh;
    overflow: auto;
}

.interests-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    margin: 10px 0 14px;
}

.interest-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    background: #020617;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid rgba(30, 64, 175, 0.5);
}

.custom-interest-block {
    margin-bottom: 12px;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

