/* =========================
   🎨 GLOBAL
========================= */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: Georgia, serif;
    color: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* 🔥 BAKGRUNDSBILD */
    background-image: url('/assets/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* 🔥 Overlay (fixad så den INTE blockerar klick) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: 0;
    pointer-events: none; /* 🔥 VIKTIG FIX */
}

/* 🔥 FIX: ta bort z-index som sabbade dropdown */
body > * {
    position: relative;
}

/* 🔥 Globala bildfixar */
img {
    max-width: 100%;
    height: auto;
}

/* Container fix */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 0 16px;
    margin: 0 auto;
}

/* =========================
   TOP BAR
========================= */
.top-bar {
    background: #AD3F8B;
    color: white;
    padding: 10px 0;
    font-family: Georgia, serif;
    font-weight: bold;    
    font-size: 18px;
    letter-spacing: 0.5px;
}

.top-bar .container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =========================
   🧭 NAVBAR
========================= */
.nav,
.navbar {
    background-color: #fff !important;
    padding: 10px 0;
    position: relative;
    z-index: 1000; /* 🔥 säkerställer att navbar ligger över allt */
}

.navbar-brand img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.navbar-brand {
    font-family: Tahoma, sans-serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: #000 !important;
}

.nav-link.active {
    color: #AD3F8B !important;
    font-weight: bold;
}

/* 🔥 KRITISK FIX */
.dropdown-menu {
    border-radius: 10px;
    border: none;
    z-index: 9999; /* 🔥 gör dropdown klickbar */
}

.dropdown-item:hover {
    background-color: #f2f2f2;
}

/* =========================
   🧱 CARDS
========================= */
.card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: 0.2s;
    background: #fff;
}

.card:hover {
    transform: translateY(-4px);
}

.card h5 {
    font-size: 16px;
}

.card p {
    font-size: 14px;
}

/* =========================
   🏷️ RUBRIKER
========================= */
h1, h2, h3 {
    font-family: Tahoma, sans-serif;
    font-weight: bold;
    color: #AD3F8B;
}

/* =========================
   🔘 KNAPPAR
========================= */
.btn {
    border-radius: 10px;
    font-weight: 500;
}

.btn-primary {
    background-color: #AD3F8B;
    border: none;
}

.btn-primary:hover {
    background-color: #922f75;
}

.btn-success {
    background-color: #1F7A8C;
    border: none;
}

.btn-success:hover {
    background-color: #155e6b;
}

.btn-warning {
    background-color: #AD3F8B;
    border: none;
    color: #fff;
}

.btn-start {
    background: #AD3F8B;
    color: white;
}

/* LOGOUT */
.logout-btn {
    background: #AD3F8B;
    color: white;
    padding: 6px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-family: Tahoma, sans-serif;
    font-weight: bold;
    font-size: 14px;
}

.logout-btn:hover {
    background: #1F7A8C;
}

/* =========================
   PRODUKTBILDER
========================= */
.product-image-wrapper {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.product-image {
    max-height: 180px !important;
    max-width: 100% !important;
    object-fit: contain !important;
    width: auto !important;
    height: auto !important;
}

/* =========================
   📊 TABLE
========================= */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

/* =========================
   📦 INPUT
========================= */
.form-control {
    border-radius: 8px;
}

/* =========================
   🎯 BADGES
========================= */
.badge.bg-success {
    background-color: #1F7A8C !important;
}

.badge.bg-warning {
    background-color: #AD3F8B !important;
}

/* =========================
   📱 MOBIL
========================= */
@media (max-width: 768px) {

    body {
        background: none;
    }

    h1 {
        font-size: 22px;
    }

    .top-bar {
        font-size: 16px;
        padding: 8px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .card {
        margin-bottom: 20px;
    }

    .row {
        display: flex;
        flex-direction: column;
    }
}

/* 🔥 Ta bort hover-effekt på mobil */
@media (hover: none) {
    .card:hover {
        transform: none;
    }
}

/* =========================
   🔐 LOGIN FINAL POLISH
========================= */

.login-card {
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.88);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    padding: 30px;
    transition: 0.3s;
    animation: loginFade 0.5s ease;
}

.login-card:hover {
    transform: translateY(-2px);
}

@keyframes loginFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card img {
    margin-bottom: 10px;
}

.login-card h3 {
    font-family: Tahoma, sans-serif;
    font-weight: bold;
    color: #AD3F8B;
}

.login-card .form-control {
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #ddd;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    transition: all 0.2s;
}

.login-card .form-control:focus {
    background: #fff;
    border-color: #AD3F8B;
    box-shadow: 0 0 0 3px rgba(173,63,139,0.2);
}

.login-card .btn-primary {
    background-color: #AD3F8B !important;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(173,63,139,0.3);
    transition: 0.2s;
}

.login-card .btn-primary:hover {
    background-color: #922f75 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(173,63,139,0.4);
}

.login-links a {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 6px;
    transition: 0.2s;
}

.login-links a:hover {
    color: #AD3F8B;
}

.login-links a + a {
    margin-top: 5px;
}

#search,
#sort {
  display: none;
}

#breadcrumb {
  display: none;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
}

/* gör att den öppnas på hover (valfritt) */
.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.footer-bottom {
    background-color: #1f7a8c; /* blågrön */
}

.page-content {
    flex: 1;
}

#search-filer {
    position: relative;
    z-index: 5;
}

#items {
    background: #f5f5f5;
}

.dropdown-divider-dashed {
  border-top: 1px dashed rgb(0, 25, 0);
}

/* =========================
   🔧 FIX: TA BORT GAMLA PROBLEM
========================= */

/* ❌ TA BORT att search göms */
#search,
#sort {
    display: block !important;
}

/* ❌ Visa breadcrumb igen */
#breadcrumb {
    display: block !important;
}


/* =========================
   🔍 SEARCH (NYTT)
========================= */

.search-wrapper {
    position: relative;
    max-width: 500px;
}

#search {
    width: 100%;
    padding-right: 35px;
    background: #fff !important;
    border: 1px solid #ced4da !important;
    border-radius: 8px;
    padding: 10px 12px;
}

/* ❌ clear knapp (X) */
#clearSearch {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 14px;
    color: #999;
    display: none;
}

#clearSearch:hover {
    color: #000;
}

/* focus effect */
#search:focus {
    outline: none;
    border-color: #AD3F8B !important;
    box-shadow: 0 0 0 2px rgba(173,63,139,0.2);
}


/* =========================
   📦 INPUT GLOBAL FIX
========================= */

/* säkerställ att inputs aldrig blir osynliga igen */
.form-control {
    border-radius: 8px;
    background: #fff !important;
    border: 1px solid #ced4da !important;
}


/* =========================
   📁 FILE LIST (lite snyggare)
========================= */

#items {
    background: #f5f5f5;
    border-radius: 10px;
}

.item {
    transition: 0.15s;
}

.item:hover {
    background: #eef3ff;
}


/* =========================
   ⭐ SHORTCUTS (förbättrad)
========================= */

.shortcut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f1f3f5;
    border-radius: 20px;
    margin-right: 6px;
    cursor: pointer;
    transition: 0.15s;
}

.shortcut:hover {
    background: #e2e6ea;
}

.shortcut.active {
    background: #dbeafe;
    font-weight: bold;
}

.shortcut .remove {
    font-size: 12px;
    color: #dc3545;
    cursor: pointer;
}

#scrollToTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: #6c757d; /* Bootstrap secondary */
    color: #fff;

    border: none;
    border-radius: 50%;

    font-size: 16px;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;

    z-index: 9999;
}

#scrollToTopBtn:hover {
    background-color: #5c636a; /* Bootstrap hover */
    transform: translateY(-2px);
}

#scrollToTopBtn:active {
    transform: scale(0.95);
}