/* súbor: css/style.css - Tvoj vlastný CSS kód z návrhu */

/* Moderné premenné */
:root {
    --color-primary-fresh: #007bff;     /* Svieža Modrá (Použité aj pre cenu) */
    --color-secondary-bright: #ff5722;  /* Jasná Oranžová (Použité pre hlavné CTA) */
    --color-text-dark: #212529;
    --color-text-light: #6c757d;
    --color-bg-light: #f8f9fa;
    --color-bg-dark: #343a40;
    --color-border: #dee2e6;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Oswald', sans-serif;
}

/* ----------------------------------------------------
    ZÁKLADNÉ NASTAVENIA
---------------------------------------------------- */
body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-text-dark);
    background-color: #ffffff;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3, h4 {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--color-text-dark);
}

a {
    color: var(--color-primary-fresh);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--color-secondary-bright);
}

/* ----------------------------------------------------
    TLAČIDLÁ
---------------------------------------------------- */
.btn-login, .btn-register, .btn-secondary, .btn {
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn-login {
    background-color: transparent;
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
}

.btn-login:hover {
    background-color: var(--color-bg-light);
}

.btn-register {
    background-color: var(--color-secondary-bright);
    color: white;
    border-color: var(--color-secondary-bright);
}

.btn-register:hover {
    background-color: #e64a19; /* Trochu tmavšia oranžová */
}

.btn-view-ad {
    display: block;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    background-color: var(--color-primary-fresh);
    color: white;
    border-radius: 0 0 8px 8px;
    margin: -20px -20px 0 -20px; /* Pre rozšírenie na celú šírku karty */
    transition: background-color 0.3s;
}

.btn-view-ad:hover {
    background-color: #0056b3;
    color: white;
}

/* ----------------------------------------------------
    HLAVIČKA (HEADER)
---------------------------------------------------- */
.header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Pre mobilné zobrazenie */
}

.header > * {
    padding: 0 10px; /* Vnútorný padding pre lepšiu viditeľnosť na krajoch */
}

.logo {
    font-family: var(--font-secondary);
    font-size: 1.8em;
    font-weight: 900;
    color: var(--color-secondary-bright);
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-links a {
    margin: 0 15px;
    font-weight: 500;
    color: var(--color-text-dark);
}

.nav-links a:hover {
    color: var(--color-primary-fresh);
}

.auth-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.welcome-message {
    color: var(--color-text-light);
    font-size: 0.9em;
}

/* ----------------------------------------------------
    HERO BANNER
---------------------------------------------------- */
.hero-banner {
    background-color: var(--color-bg-dark); /* Tmavý podklad pre kontrast */
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero-banner h1 {
    color: white;
    font-size: 2.8em;
    margin-bottom: 10px;
}

.hero-banner p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 30px;
}

.search-bar {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 40px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.search-bar input, 
.search-bar select {
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    flex-grow: 1;
    font-family: var(--font-primary);
}

.search-bar button {
    background-color: var(--color-primary-fresh);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.search-bar button:hover {
    background-color: #0056b3;
}

/* Karusel a veľký text */
.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 30px;
    padding-top: 20px;
}

.hero-text-large {
    flex: 1.5;
    padding-right: 30px;
}

.hero-text-large h2 {
    color: var(--color-secondary-bright);
    font-size: 2.2em;
    margin-bottom: 15px;
}

.hero-image {
    flex: 1;
    position: relative;
    max-width: 400px;
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    border-radius: 10px;
    transform: translateX(0);
}

.carousel-image.active {
    opacity: 1;
}

/* Karusel ANIMÁCIA */
@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-image.animate-out {
    animation: slideOut 1.2s forwards;
}

.carousel-image.animate-in {
    animation: slideIn 1.2s forwards;
}

/* ----------------------------------------------------
    SEKCIA INZERÁTOV
---------------------------------------------------- */
.ad-section {
    padding: 50px 0;
    background-color: white;
}

.ad-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2em;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.ad-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 5px solid var(--color-primary-fresh); /* Farba sa dynamicky mení v PHP */
    overflow: hidden;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.ad-card-image-placeholder {
    height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: 8px 8px 0 0;
}

.ad-card-content {
    padding: 20px;
}

.ad-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    min-height: 40px;
}

.ad-card-header h3 {
    font-size: 1.2em;
    margin: 0;
    line-height: 1.3;
}

.price {
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 1.3em;
    color: var(--color-primary-fresh); /* Farba sa dynamicky mení v PHP */
    margin-left: 15px;
    white-space: nowrap;
}

.ad-card-meta {
    font-size: 0.85em;
    color: var(--color-text-light);
    margin-bottom: 15px;
}

.ad-card-meta i {
    margin-right: 5px;
}

.ad-card-profile {
    display: flex;
    align-items: center;
    padding-top: 15px;
    border-top: 1px dashed var(--color-border);
}

.profile-pic {
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background-color: #f1c40f; /* Dynamicky sa mení v PHP */
    color: white;
    font-weight: bold;
    text-align: center;
    margin-right: 10px;
}

.profile-info .name {
    font-size: 0.9em;
    font-weight: 500;
}

.rating i {
    color: gold;
    font-size: 0.9em;
}


/* ----------------------------------------------------
    CTA (Výzva k akcii)
---------------------------------------------------- */
.cta-section {
    background-color: var(--color-primary-fresh);
    color: white;
    padding: 50px 0;
    text-align: center;
}

.cta-section h2 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.cta-section p {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-section .btn-register {
    padding: 12px 25px;
    font-size: 1em;
}

/* ----------------------------------------------------
    PÄTIČKA (FOOTER)
---------------------------------------------------- */
.footer {
    background-color: var(--color-bg-dark);
    color: #0056b3;
    padding: 50px 0 20px;
    font-size: 0.9em;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer h4 {
    color: var(--color-secondary-bright);
    font-size: 1.1em;
    margin-bottom: 15px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 8px;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
}

.footer a:hover {
    color: var(--color-primary-fresh);
}

.social-icons a {
    font-size: 1.5em;
    margin-right: 15px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}


/* ----------------------------------------------------
    RESPONZÍVNE ÚPRAVY
---------------------------------------------------- */
@media (max-width: 900px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header > * {
        padding: 10px 0;
    }
    .nav-links {
        order: 3; /* Presunie menu pod logo */
        width: 100%;
        text-align: center;
    }
    .nav-links a {
        display: block;
        padding: 5px 0;
        margin: 5px 0;
    }
    .auth-actions {
        order: 2; /* Presunie akcie vedľa loga */
        margin-left: auto;
    }
    
    .hero-banner {
        padding: 40px 0;
    }
    .hero-banner h1 {
        font-size: 2.2em;
    }
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-text-large {
        padding-right: 0;
        order: 2;
    }
    .hero-image {
        order: 1;
        height: 300px;
        margin: 0 auto 20px;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}