:root {
    --primary: #1a2a6c;
    --secondary: #2ecc71;
    --light: #f8f9fa;
    --dark: #2d3436;
    --text: #636e72;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Nawigacja */
.navbar {
    background: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
}

.logo span { color: var(--secondary); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    transition: 0.3s;
}

.btn-highlight {
    background: var(--primary);
    color: white !important;
    padding: 10px 20px;
    border-radius: 50px;
}

/* Dropdown Menu */
.nav-links li {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 15px;
    padding: 10px 0;
    z-index: 1001;
    margin-top: 15px;
}

/* Niewidoczny mostek, aby menu nie znikało podczas przesuwania myszki */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dropdown-content a {
    display: block;
    padding: 12px 20px;
    color: var(--dark);
    text-decoration: none;
    transition: 0.3s;
    font-weight: 500;
    text-align: center;
}

.dropdown-content a:hover {
    background-color: var(--light);
    color: var(--primary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(26, 42, 108, 0.8), rgba(26, 42, 108, 0.8)), 
                url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?q=80&w=1500&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    padding: 100px 0;
    color: white;
    text-align: center;
}

.hero h1 { font-size: 3rem; margin-bottom: 20px; font-weight: 800; }
.hero p { font-size: 1.2rem; margin-bottom: 40px; opacity: 0.9; }

/* Wyszukiwarka */
.search-box {
    background: white;
    padding: 10px;
    border-radius: 50px;
    display: flex;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-field {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-right: 1px solid #eee;
}

.search-field i { color: var(--primary); margin-right: 10px; }

.search-field select {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    color: var(--dark);
    cursor: pointer;
}

.btn-search {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-search:hover { background: #27ae60; }

/* Siatka Ofert */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { font-size: 2rem; color: var(--primary); }

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.property-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid #eee;
}

.property-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

.property-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.5s ease;
    cursor: pointer;
}

.property-card:hover .property-img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.property-content { padding: 25px; }
.property-content h3 { margin-bottom: 10px; font-size: 1.2rem; }
.params { font-size: 0.9rem; color: var(--text); margin-bottom: 20px; }
.params i { color: var(--primary); margin-right: 5px; }

.price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 20px;
}

.price span { font-size: 1rem; color: var(--text); font-weight: 400; }

.availability {
    font-size: 0.95rem;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 20px;
}

.buttons-container {
    display: flex;
    gap: 10px;
}

.btn-view {
    flex: 1; /* Zajmuje dostępną przestrzeń */
    padding: 12px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-view:hover { background: var(--primary); color: white; }

.btn-call {
    width: 50px;
    background: transparent;
    border: 2px solid #2ecc71;
    color: #2ecc71;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-call:hover { background: #2ecc71; color: white; }

.btn-share {
    width: 50px;
    background: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-share:hover { background: var(--secondary); color: white; }

/* Responsywność */
@media (max-width: 768px) {
    .search-box { flex-direction: column; border-radius: 20px; padding: 20px; gap: 15px; }
    .search-field { border-right: none; border-bottom: 1px solid #eee; padding-bottom: 10px; }
    .hero h1 { font-size: 2rem; }
    .nav-links { display: none; }
}

/* Sekcja dla Właścicieli */
.owner-section {
    background-color: #f0f3f8;
    border-top: 1px solid #e0e6ed;
}

.owner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.owner-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.owner-card i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 20px;
}

.owner-card h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.cta-center {
    text-align: center;
}

.btn-main {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 18px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.btn-main:hover {
    background: var(--dark);
    transform: scale(1.05);
}

/* Stopka */
.main-footer {
    background: var(--primary);
    color: white;
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info .logo {
    color: white;
    margin-bottom: 15px;
}

.footer-contact h4, .footer-social h4 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--secondary);
}

.footer-contact a, .footer-social a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    opacity: 0.8;
    transition: 0.3s;
}

.footer-contact a:hover, .footer-social a:hover {
    opacity: 1;
    color: var(--secondary);
}

.fb-link i {
    font-size: 1.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

.footer-bottom a {
    color: var(--white);
    font-weight: bold;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--secondary); /* Zielony kolor RentMaster */
    opacity: 1;
}

/* Poprawka responsywności */
@media (max-width: 768px) {
    .owner-section { padding: 50px 0; }
    .footer-grid { text-align: center; }
    .footer-contact a, .footer-social a { justify-content: center; }
}

/* Animacja rozwijania opisu */
.opis-animacja {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out, margin-top 0.5s ease-in-out;
    margin-top: 0 !important; /* Ukrywamy margines gdy zwinięte */
}

.opis-animacja.otwarte {
    opacity: 1;
    margin-top: 15px !important; /* Przywracamy margines po rozwinięciu */
}

/* Formularz kontaktowy */
.contact-form-wrapper {
    max-width: 600px;
    margin: 40px auto 0;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.contact-form-wrapper h3 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.contact-form button.btn-main {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 10px;
}

/* Sekcja Zaufali nam w stopce */
.trusted-section {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 30px;
}

.trusted-section h4 {
    color: var(--secondary);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.trusted-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.trusted-logos a {
    display: block;
}

.trusted-logos img {
    height: 70px;
    width: 70px;
    object-fit: contain;
    border-radius: 50%;
    background-color: #ffffff;
    padding: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    filter: grayscale(100%);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.trusted-logos img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--hover-color);
}

/* Custom Tooltip (Dymek z opisem) */
.logo-tooltip {
    position: relative;
    display: inline-block;
}
.logo-tooltip::before, .logo-tooltip::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 1100;
}
.logo-tooltip::after {
    content: attr(data-tooltip);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--secondary);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-bottom: 12px;
}
.logo-tooltip::before {
    content: '';
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 6px solid transparent;
    border-top-color: var(--secondary);
    margin-bottom: 0px;
}
.logo-tooltip:hover::before, .logo-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Przycisk nawigacji w opisie */
.btn-navigate {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #4285F4; /* Kolor Google Maps */
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 10px;
    font-weight: 700;
    transition: 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-navigate:hover {
    background-color: #3367D6;
    transform: translateY(-2px);
}

.btn-navigate i {
    margin-right: 8px;
}

/* Przycisk powrotu do góry */
#btn-back-to-top {
    display: none; /* Domyślnie ukryty */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--secondary);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 30%;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s, transform 0.3s;
}

#btn-back-to-top:hover {
    background-color: #27ae60;
    transform: translateY(-5px);
}

/* =========================================
   PASEK "W PRZEBUDOWIE" (RIBBON)
   ========================================= */
.ribbon-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    overflow: hidden;
    z-index: 9999; /* Zawsze na wierzchu */
    pointer-events: none; /* Pozwala klikać "przez" puste miejsce w rogu */
}

.ribbon {
    position: absolute;
    top: 49px;
    right: -29px;
    width: 200px;
    background-color: #FFB400; /* Żółty kolor ostrzegawczy */
    color: #000;
    text-align: center;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 8px 0;
    transform: rotate(45deg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    letter-spacing: 1px;
    pointer-events: auto;
}

/* =========================================
   GALERIA (LIGHTBOX)
   ========================================= */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10002;
}

.close:hover { color: #bbb; }

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 25px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3);
    z-index: 10002;
}

.next { right: 0; border-radius: 3px 0 0 3px; }
.prev { left: 0; border-radius: 3px 0 0 3px; }
.prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); }

.zoom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10002;
}

.zoom-controls button {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 1.2rem;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 50px;
    transition: 0.3s;
    outline: none;
}

.zoom-controls button:hover { background: rgba(255, 255, 255, 0.8); color: #000; }

.gallery-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
}

/* =========================================
   BADGE "WYNAJĘTE"
   ========================================= */
.rented-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    backdrop-filter: blur(2px);
}

.rented-text {
    background-color: #e74c3c;
    color: #fff;
    padding: 10px 30px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    transform: rotate(-15deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    letter-spacing: 2px;
}

/* =========================================
   BADGE "OKAZJA"
   ========================================= */
.bargain-card {
    border: 2px solid #e67e22;
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.15);
}

.badge-bargain {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e67e22;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    z-index: 4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* =========================================
   BADGE "WYNAJĘTE"
   ========================================= */
.rented-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6); /* Lekko mleczne tło */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    backdrop-filter: blur(2px);
}

.rented-text {
    background-color: #e74c3c;
    color: #fff;
    padding: 10px 30px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    transform: rotate(-15deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    letter-spacing: 2px;
}

/* Przycisk instalacji PWA */
.btn-install {
    margin-top: 15px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #bdc3c7;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-install:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
    color: var(--white);
}

/* Potwierdzenie wysłania formularza */
.form-success {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    border: 2px solid var(--primary);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.form-success h3 { color: var(--primary); margin-bottom: 15px; font-size: 1.8rem; }
.form-success p { color: var(--text); font-size: 1.1rem; }

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* Animacje wejścia (Fade-in) */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}