/* ========== Variables & Reset ========== */
:root{
  --bg: #f4f5f7;
  --card: #ffffff;
  --muted: #6b7280;
  --primary: #0073e6;
  --nav-grad-1: #111216;
  --nav-grad-2: #222428;
  --glass: rgba(255,255,255,0.6);
  --radius: 12px;
  --shadow-1: 0 6px 18px rgba(12,20,30,0.08);
  --shadow-2: 0 10px 30px rgba(12,20,30,0.12);
  font-size: 16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:var(--bg);
  color:#111827;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.5;
}

/* ========== Layout ========== */
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

/* ========== NAVBAR ========== */
.navbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:1200;
  background: linear-gradient(90deg, var(--nav-grad-1), var(--nav-grad-2));
  color:#fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}

.nav-container{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:10px 16px;
}

.logo{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:0.2px;
  font-size:1.05rem;
  color:#fff;
}

.logo img{
  height:35px;
  width:auto;
}

/* menu toggle for mobile */
.menu-toggle{
  display:none;
  font-size:1.4rem;
  cursor:pointer;
  user-select:none;
}

/* links */
.nav-links{
  display:flex;
  align-items:center;
  gap:6px;
  list-style:none;
  margin:0;
  padding:0;
}

.nav-links li{position:relative}
.nav-links a{
  display:block;
  padding:10px 14px;
  border-radius:8px;
  color:#fff;
  font-weight:500;
  transition:background .18s ease, transform .12s ease;
}
.nav-links a:hover{
  background:rgba(255,255,255,0.06);
  transform:translateY(-2px);
}

/* ================= DROPDOWN (KLICK) ================= */
.dropdown .dropdown-content{
  display:none;
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  min-width:210px;
  background:var(--card);
  color:#111;
  border-radius:10px;
  box-shadow:var(--shadow-2);
  overflow:hidden;
  z-index:1400;
}

/* Ta bort hover-effekt */
.dropdown:hover .dropdown-content{
  display: none;
}

.dropdown .dropdown-content a{
  display:block;
  padding:12px 14px;
  color:var(--muted);
  font-size:0.95rem;
}

/* Öppnas ENDAST via JS (.open) */
.dropdown.open .dropdown-content{
  display:block;
}

/* Pil bredvid Meny */
.dropdown-toggle::after {
    content: "\25BC"; /* nedåtpil */
    margin-left: 6px;
    font-size: 0.7em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.dropdown-toggle.open::after {
    transform: rotate(180deg);
}

/* ========== Header / Carousel ========== */
header{margin-top:68px}

.carousel{
  width:100%;
  height:340px;
  max-height:48vh;
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.0));
}

.carousel-image{
  position:absolute;
  inset:0;
  background-position:center;
  background-size:cover;
  transition:opacity 0.9s ease, transform 1s ease;
  opacity:0;
  transform:scale(1.02);
}

.carousel::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.06));
  pointer-events:none;
}

/* ========== Main content card ========== */
main{
  max-width:1100px;
  margin:28px auto;
  padding:26px;
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow-1);
  transform:translateY(-30px);
}

/* ========== Profile cards ========== */
.profile{
  display:flex;
  gap:18px;
  align-items:center;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(250,250,250,0.5));
  border-radius:12px;
  padding:18px;
  margin:20px 0;
  position:relative;
  overflow:hidden;
  box-shadow: 0 6px 20px rgba(8,20,40,0.06);
  transition:transform .35s cubic-bezier(.2,.9,.2,1), box-shadow .25s;
  opacity:0;
  transform:translateY(18px);
}

.profile.show{opacity:1; transform:translateY(0)}
.profile:hover{transform:translateY(-6px); box-shadow: 0 12px 34px rgba(8,20,40,0.12)}

.profile img{
  width:110px;
  height:110px;
  border-radius:999px;
  object-fit:cover;
  flex-shrink:0;
  border:4px solid rgba(255,255,255,0.85);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.profile > div{
  flex:1;
  min-width:0;
}
.position{
  color:var(--primary);
  font-weight:600;
  margin-bottom:6px;
  font-size:.98rem;
}
.profile h2{
  margin:0 0 6px 0;
  font-size:1.1rem;
}
.profile p{margin:4px 0; color:var(--muted); font-size:0.97rem;}

.profile-overlay{
  position:absolute;
  inset:0;
  background-position:center;
  background-size:cover;
  opacity:0;
  transition:opacity .3s ease;
  filter:brightness(.55) saturate(.85);
  z-index:0;
}
.profile:hover .profile-overlay{opacity:0.28}

.profile > img, .profile > div{position:relative; z-index:2}

/* ========== Social media block ========== */
.social-media{ text-align:center; margin-top:26px; padding-top:8px; border-top:1px dashed #eee}
.social-media h3{margin:6px 0 10px 0}
.social-media a{display:inline-block; margin:0 8px; transition:transform .18s}
.social-media a:hover{transform:translateY(-4px)}

/* ========== Footer ====== */
footer{
  margin:28px auto 60px;
  max-width:1100px;
  text-align:center;
  color:var(--muted);
  font-size:0.95rem;
}

/* ========== Responsive ========== */
@media (max-width:900px){
  .nav-container{padding:10px}
  .carousel{height:300px}
  .profile{padding:14px}
  .profile img{width:92px;height:92px}
}

@media (max-width:720px){
  .menu-toggle{display:block}
  .nav-links{
    position:fixed;
    right:16px;
    top:64px;
    background:linear-gradient(180deg, rgba(17,18,22,0.98), rgba(34,36,40,0.98));
    border-radius:12px;
    padding:12px;
    display:flex;
    flex-direction:column;
    gap:6px;
    box-shadow:var(--shadow-2);
    transform:translateY(-12px) scale(.98);
    opacity:0;
    pointer-events:none;
    transition:opacity .18s, transform .18s;
  }
  .nav-links.active{
    opacity:1;
    pointer-events:auto;
    transform:translateY(0) scale(1);
  }
  .dropdown .dropdown-content{
    position:relative;
    top:0;
    left:0;
    box-shadow:none;
    border-radius:8px;
    margin-top:6px;
  }
  .nav-links a{padding:10px 14px; white-space:nowrap}
}

/* ========== Accessibility / prefers-reduced-motion ========== */
@media (prefers-reduced-motion: reduce){
  .carousel-image, .profile, .nav-links, .profile:hover{transition:none!important; animation:none!important}
}

/* ========== Dark mode support ========= */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0c10;
    --card:#0f1115;
    --muted:#9aa4b2;
    --nav-grad-1:#070708;
    --nav-grad-2:#131416;
    --glass: rgba(255,255,255,0.03);
  }
  body{color:#e6eef8}
  .nav-links a{color:#e6eef8}
  .dropdown .dropdown-content{background:var(--card); color:var(--muted)}
  footer{color:var(--muted)}
}

/* ===== Confirm overlay för externa länkar ===== */
#confirmOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-box {
    background: var(--card);
    color: var(--muted);
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
    max-width: 320px;
    box-shadow: var(--shadow-2);
}

.confirm-box p {
    margin-bottom: 20px;
    font-weight: 500;
}

.confirm-buttons button {
    padding: 8px 16px;
    margin: 0 6px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s;
}

#confirmYes {
    background-color: var(--primary);
    color: #fff;
}

#confirmNo {
    background-color: #ccc;
    color: #111;
}

.confirm-buttons button:hover {
    transform: translateY(-2px);
}
