/* GLOBAL */
body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: #f7f7f7;
    color: #222;
}
/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: #1f2937;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header .logo img {
    height: 50px;
    width: auto;
}
/* Endast direkta länkar i nav, inte de i dropdownen */
.header > nav > a {
    margin-left: 20px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
}

/* HERO */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(to bottom, #ffffff, #eef1f5);
}
.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 10px;
}
.search-container input {
    width: 60%;
    padding: 14px 20px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-top: 20px;
}
.cta-buttons {
    margin-top: 25px;
}
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin: 0 8px;
    cursor: pointer;
}
.primary {
    background: #ff8a00;
    color: white;
}
.secondary {
    background: #e0e0e0;
    color: #333;
}
/* GRID */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    padding: 20px 40px;
}
/* KATEGORIER */
.category-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px;
}
.category-btn {
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    background: #ddd;
    cursor: pointer;
    font-weight: 500;
}
/* SEKTIONER */
.latest-ads,
.all-ads {
    padding: 40px;
    background: #fff;
    min-height: 300px;
}
/* FOOTER */
footer {
    text-align: center;
    padding: 30px;
    background: #fff;
    margin-top: 40px;
}
/* HEADER CTA */
.create-ad-link {
    background: #ff8a00;
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
}
/* FORMULÄR */
.form-section {
    max-width: 600px;
    margin: 60px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.ad-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.ad-form input,
.ad-form textarea,
.ad-form select {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}
.ad-form textarea {
    height: 120px;
}
.form-message {
    background: #e6ffe6;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #0a7a0a;
    font-weight: 600;
}
.listing-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    min-height: 250px;
}
.listing-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.create-account-btn {
    background: #007bff;
    color: white !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
}
.create-account-btn:hover {
    background: #0069d9;
}

.user-badge {
    background: #e0f0ff;
    color: #0056b3;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    margin-right: 15px;
}

.logout-link {
    background: #ff4d4d;
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.logout-link:hover {
    background: #e60000;
}

.create-account-link {
    background: #007bff;
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.create-account-link:hover {
    background: #0069d9;
}

/* Profilmeny container */
.profile-menu {
    position: relative;
    display: inline-block;
}

.profile-btn {
    background: #f0f0f0;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    color: #000; /* SVART TEXT */
}

.profile-dropdown p {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #000;
}

/* Tvinga svart text i dropdownen */
.profile-dropdown a {
    display: block !important;
    color: #000 !important;
    margin-left: 0 !important;
}



.profile-dropdown a:hover {
    text-decoration: underline;
}

.profile-menu.active .profile-dropdown {
    display: block;
}


/* MIN PROFIL */
.profile-section {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.profile-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.profile-info {
    margin: 20px 0;
    text-align: left;
}

.profile-info p {
    margin: 8px 0;
    font-size: 16px;
}

.profile-actions {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.profile-settings {
    text-align: left;
    margin-top: 20px;
}

.profile-settings h3 {
    margin-bottom: 10px;
}

.btn.light {
    background: #f0f0f0;
    padding: 10px 16px;
    border-radius: 6px;
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

.btn.danger {
    background: #ff4d4d;
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    display: block;
    width: 100%;
    margin-top: 10px;
}


/* MINA ANNONSER */
.my-ads-section {
    padding: 40px 20px;
    max-width: 1100px;
    margin: auto;
}

.my-ads-section h2 {
    text-align: center;
    margin-bottom: 30px;
}

.no-ads-box {
    text-align: center;
    background: #f8f8f8;
    padding: 40px;
    border-radius: 12px;
}

.my-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.my-ad-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
}

.my-ad-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
}

.my-ad-card h3 {
    margin: 12px 0 6px;
}

.my-ad-card .price {
    font-weight: bold;
    margin-bottom: 15px;
}

.my-ad-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn.light {
    background: #f0f0f0;
    padding: 8px 14px;
    border-radius: 6px;
}

.btn.danger {
    background: #ff4d4d;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
}

/* ANNONSDETALJ */

.ad-detail-section {
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
}

.ad-detail-card {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.ad-detail-image img {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

.ad-detail-info {
    flex: 1;
    min-width: 300px;
}

.ad-price {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0 20px;
}

.ad-actions {
    margin-top: 25px;
    display: flex;
    gap: 12px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .ads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .search-container input {
        width: 90%;
    }
    .header .logo img {
        height: 50px;
    }
}