/* === IngatlanPortál - Főstílus === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --primary: #1a3a5c;
    --primary-light: #2560a0;
    --accent: #e8913a;
    --accent-light: #f4b06a;
    --success: #2d8a4e;
    --danger: #c0392b;
    --bg: #f5f3ef;
    --bg-card: #ffffff;
    --text: #1c1c1c;
    --text-muted: #6b7280;
    --border: #ddd8d0;
    --shadow: 0 2px 16px rgba(26,58,92,0.10);
    --shadow-hover: 0 8px 32px rgba(26,58,92,0.18);
    --radius: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* === HEADER === */
.site-header {
    background: var(--primary);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.site-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

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

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent-light); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.3rem;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,145,58,0.35); }
.btn-secondary { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.5); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #256b3e; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 0.75rem 1.8rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.82rem; }
.btn-full { width: 100%; justify-content: center; }

/* === HERO === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0f2440 60%, #1a3a5c 100%);
    padding: 5rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: #fff;
    margin-bottom: 0.75rem;
    position: relative;
}

.hero p {
    color: rgba(255,255,255,0.72);
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
    position: relative;
}

/* === KERESŐDOBOZ === */
.search-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--shadow-hover);
    position: relative;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.search-box .form-group { margin: 0; }
.search-box label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; display: block; font-weight: 500; }

/* === KÁRTYÁK === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3rem 0; }
.section-title { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--primary); margin-bottom: 0.25rem; }
.section-subtitle { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; }

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.property-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border);
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #e0e8f0, #c8d8e8);
    position: relative;
}

.card-img-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #e0e8f0 0%, #c8d8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-light);
    opacity: 0.5;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-img-wrap { position: relative; }

.card-body { padding: 1.25rem 1.5rem; }
.card-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.card-address { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.card-seller {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

.seller-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.seller-info { flex: 1; min-width: 0; }
.seller-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seller-phone { font-size: 0.8rem; color: var(--text-muted); }

.card-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-meta-item strong { color: var(--text); }

/* === FORM STÍLUS === */
.form-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.form-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--primary);
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, rgba(26,58,92,0.06), transparent);
    border-left: 3px solid var(--accent);
    margin: 1.5rem 0 1.25rem;
    border-radius: 0 6px 6px 0;
}

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

.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

label .req { color: var(--accent); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
select,
textarea {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: var(--text);
    background: #fff;
    transition: all 0.2s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,96,160,0.12);
}

select { cursor: pointer; }
textarea { resize: vertical; min-height: 120px; }

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    transition: all 0.2s;
    user-select: none;
}

.checkbox-item:hover { border-color: var(--primary-light); background: rgba(37,96,160,0.04); }

.checkbox-item input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-item input:checked + span { color: var(--primary); font-weight: 600; }
.checkbox-item:has(input:checked) { border-color: var(--primary); background: rgba(37,96,160,0.07); }

/* === FELSŐ FUNKCIÓSÁV (hirdetés feltöltő) === */
.action-bar {
    background: var(--primary);
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 0;
}

.action-bar::-webkit-scrollbar { display: none; }

.action-bar-btn {
    flex-shrink: 0;
    padding: 0.9rem 1.3rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    background: none;
    border-right: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.action-bar-btn:hover,
.action-bar-btn.active { background: rgba(255,255,255,0.1); color: #fff; }

.action-bar-spacer { flex: 1; }

.action-bar-btn.delete-btn {
    color: #ff8a80;
    margin-left: auto;
}

.action-bar-btn.delete-btn:hover { background: rgba(192,57,43,0.3); color: #ff6b6b; }

/* === HIRDETÉS INFO SÁV === */
.listing-info-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    padding: 0.75rem 1.5rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 2rem;
}

.listing-info-bar strong { color: var(--text); }

/* === BEJELENTKEZÉSI OLDAL === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #0f2440 100%);
    padding: 2rem;
}

.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.25rem;
}

.login-logo span { color: var(--accent); }
.login-subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* === MODAL === */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

/* === UPLOAD ZONE === */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(37,96,160,0.02);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary-light);
    background: rgba(37,96,160,0.06);
}

.upload-zone-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.upload-zone p { font-size: 0.9rem; color: var(--text-muted); }
.upload-zone strong { color: var(--primary); }

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.preview-thumb {
    width: 100px; height: 75px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border);
}

/* === ADMIN PANEL === */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--primary);
    flex-shrink: 0;
    padding: 1.5rem 0;
}

.admin-sidebar .logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #fff;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.admin-sidebar .logo span { color: var(--accent); }

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-main {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
}

.admin-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* === TÁBLÁZAT === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.88rem;
}

.data-table th {
    background: var(--primary);
    color: #fff;
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(37,96,160,0.03); }

.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-green { background: #d4edda; color: #1a6b35; }
.badge-yellow { background: #fff3cd; color: #856404; }
.badge-red { background: #f8d7da; color: #842029; }
.badge-gray { background: #e9ecef; color: #495057; }

/* === INGATLAN RÉSZLETLAP === */
.property-detail {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.detail-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.detail-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-main { height: 420px; }
.gallery-side { display: grid; grid-template-rows: 1fr 1fr; gap: 0.75rem; }
.gallery-side-img { height: 200px; }

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.detail-info-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-info-table tr:nth-child(even) td { background: rgba(37,96,160,0.03); }
.detail-info-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.detail-info-table td:first-child { font-weight: 600; color: var(--text-muted); width: 45%; }

.contact-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 90px;
}

.contact-card-title { font-weight: 700; font-size: 1rem; margin-bottom: 1rem; color: var(--primary); }
.contact-phone { font-size: 1.3rem; font-weight: 700; color: var(--primary); display: block; margin-bottom: 1rem; text-decoration: none; }
.contact-phone:hover { color: var(--accent); }

/* === STATS KÁRTYÁK === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-card .stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }

/* === ALERT === */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success { background: #d4edda; color: #1a6b35; border: 1px solid #b8dfc5; }
.alert-danger { background: #f8d7da; color: #842029; border: 1px solid #f1b0b7; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #b8daff; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* === FOOTER === */
footer {
    background: var(--primary);
    color: rgba(255,255,255,0.65);
    text-align: center;
    padding: 2rem;
    font-size: 0.85rem;
    margin-top: 4rem;
}

footer strong { color: #fff; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .site-header { padding: 0 1rem; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-gallery { grid-template-columns: 1fr; }
    .gallery-side { grid-template-columns: 1fr 1fr; grid-template-rows: unset; }
    .gallery-side-img { height: 140px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .action-bar-btn { padding: 0.75rem 0.9rem; font-size: 0.75rem; }
}

@media (max-width: 480px) {
    .hero { padding: 3rem 1rem 2rem; }
    .form-container { padding: 1.25rem; }
    .properties-grid { grid-template-columns: 1fr; }
}

/* === ANIMÁCIÓ === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease forwards; }
.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; animation-fill-mode: forwards; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; animation-fill-mode: forwards; }

/* Elrejtett elemek JS-hez */
.hidden { display: none !important; }
