/* ========== BASE ========== */
* { box-sizing: border-box; }
html, body { height: 100%; margin:0; font-family:"Lato",sans-serif; background:#0f1113; color:#fff; }
.hidden {display: none !important;}

/* ========== NAVBAR ========== */
.site-header { position: sticky; top:0; z-index:100; }
.nav { display:flex; align-items:center; justify-content: space-between; padding:0 24px; height:60px; background:#16171c; font-weight:700;}

/* Left brand */
.nav-left { display:flex; align-items:center; gap:12px; }
.brand-logo { height:80px; }
.brand { font-weight:700; font-size:1.25rem; color:#fff; margin:0; }

/* Center nav */
.nav-center { display:flex; gap:24px; align-items:center; }
.nav-center > a { text-decoration: none; color: white; }
.nav-item { position:relative; font-size:0.95rem; cursor:pointer; padding:0 8px; line-height:60px; transition:.2s; font-weight:700; }
.nav-item:hover { color:#00aaff; }
.nav-item:hover::after { content:''; position:absolute; bottom:12px; left:0; width:100%; height:2px; background:#00aaff; border-radius:1px; }

/* Dropdown submenu */
.nav-item.with-submenu { position:relative; }
.submenu { display:none; position:absolute; top:100%; left:0; flex-direction:column; background:#16171c; min-width:160px; border-radius:6px; box-shadow:0 12px 24px rgba(0,0,0,0.6); z-index:50; }
.with-submenu:hover .submenu { display:flex; }
.submenu a { padding:10px 16px; text-decoration:none; color:#fff; font-size:0.95rem; font-weight:700; border-radius:6px; transition:0.2s; line-height: 1.4; }
.submenu a:hover { background:#222; color:#00aaff; }

/* Right buttons */
.nav-right { display:flex; align-items:center; gap:12px; }
#loginButton { padding: 10px 20px; font-size: 17px; background-color: #5b67e7; color: white; border: none; cursor: pointer; border-radius: 6px; transition: background-color 0.2s; font-weight: 700; font-family: "Lato",sans-serif; white-space: nowrap;}
#loginButton:hover {background-color: #717dff;}
#loginButton img { font-size: 18px; margin-right: 8px; vertical-align: middle; color: white; height: 25px; width: auto; }
.premium-btn { background:#FFD700; color:#000; padding:6px 16px; border-radius:6px; font-weight:700; text-decoration:none; transition:.2s; }
.premium-btn:hover { background:#e6c200; }

/* General button styles */
.nav-right { display: flex; align-items: center; gap: 12px; }

/* Avatar and User Menu */
.user-menu { position: relative; display: inline-block; width: 100%;}
.avatar-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; }
#avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 8px; object-fit: cover; }
#username { font-size: 16px; color: white; font-family: "Lato",sans-serif; font-weight: 700;}
#username:hover {color: #00aaff;}
#username:hover::after { content:''; position:absolute; bottom:5px; left:35%; width:60%; height:1px; background:#00aaff; border-radius:1px;}

#loginButtonMobile {padding: 10px 20px; font-size: 17px; background-color: #5b67e7; color: white; border: none; cursor: pointer; border-radius: 6px; width: 100%; text-align: center; transition: background-color 0.2s; font-weight: 700; font-family: "Lato",sans-serif;}
#loginButtonMobile:hover {background: #717dff;}
#avatarButtonMobile {width: 100%; text-align: left; padding: 10px 16px; background: none; border: none; color: white; font-size: 0.95rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-radius: 6px; transition: 0.2s; font-weight: 700;}
#avatarMobile {width: 40px; height: 40px; border-radius: 50%; object-fit: cover;}
#usernameMobile {font-family: "Lato",sans-serif; font-weight: 700; float: left;;}

/* Mobile Dropdown Menu Styles */
#dropdownMenuMobile {display: none; position: absolute; top: 65px; background-color: #16171c; box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.5); border: none; z-index: 100; padding: 0; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s; width: 100%; text-align: center;}
#dropdownMenuMobile.show {display: block; opacity: 1; visibility: visible; transform: translateY(0); transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;}
#dropdownMenuMobile a {color: white; padding: 8px 16px; text-decoration: none; display: block; font-weight: 700; transition: background-color 0.2s ease;}
#dropdownMenuMobile a:hover {background-color: #333;}

/* Dropdown menu styles */
#dropdownMenu {display: none; position: absolute; top: 55px; right: 0; background-color: #16171c; border-radius: 6px; width: 100%; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3); z-index: 100;}
#dropdownMenu.show {display: block; opacity: 1; visibility: visible; transform: translateY(0); transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;}
#dropdownMenu a {color: white; text-decoration: none; display: block; text-align: center; padding: 5px; transition: background-color 0.2s ease; border-radius: 6px;}
#dropdownMenu a:hover { background-color: #333; color: #00aaff; border-radius: 6px;}
#dropdownMenu a:last-child {padding-bottom: 10px;}

/* Hamburger (mobile) */
.hamburger { display:none; flex-direction:column; justify-content:center; gap:4px; background:transparent; border:none; cursor:pointer; }
.hamburger span { width:22px; height:3px; background:#fff; border-radius:2px; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.hamburger:hover span { background: #00aaff; }

/* ========== MOBILE DRAWER ========== */
.mobile-drawer { position:fixed; right:-100%; top:0; width:280px; height:100vh; background:#16171c; color:#fff; transition:right .25s ease; z-index:110; display:flex; flex-direction:column; border-left:1px solid #222; box-shadow:-4px 0 24px rgba(0,0,0,0.6); font-weight:700; overflow-y: auto; align-items: left;}
.mobile-drawer.open { right:0; }
.mobile-header { display:flex; align-items:center; justify-content: center; position: relative; top: 40px; right: 10px; margin-bottom: 100px;}
.mobile-brand { display:flex; align-items:center; gap:10px; position: absolute; left: 50%; transform: translateX(-50%);}
.mobile-brand img { height:60px; width: auto;}
.mobile-brand h2 {font-size: 1.5rem; margin: 0; color: #fff;}
.mobile-links { padding:16px; display:flex; flex-direction:column; gap:8px; overflow:visible;}

/* Mobile links & submenu */
.mobile-links a, .mobile-sub-menu a { padding:10px 16px; text-decoration:none; color:#fff; border-radius:6px; transition:0.2s; font-weight:700; }
.mobile-links a:hover, .mobile-sub-menu a:hover, #avatarButtonMobile:hover , #dropdownMenuMobile a:hover { background:#222; color:#00aaff; }
.mobile-sub { display:flex; flex-direction:column; }
.mobile-sub-menu { display:none; flex-direction:column; padding-left:0; background:#16171c; margin-top:4px; box-shadow:0 8px 16px rgba(0,0,0,0.5); }
.mobile-sub.open .mobile-sub-menu { display:flex; animation: fadeIn 0.2s ease forwards; }
@keyframes fadeIn { 0% {opacity:0; transform:translateY(-5px);} 100% {opacity:1; transform:translateY(0);} }

/* Submenu toggle button */
.mobile-sub-toggle { width:100%; text-align:left; padding:10px 16px; background:none; border:none; color:#fff; font-size:0.95rem; cursor:pointer; display:flex; justify-content:space-between; align-items:center; border-radius:6px; transition:0.2s; font-weight:700; }
.mobile-sub-toggle:hover { background:#222; color:#00aaff; }

/* ========== PAGE CONTENT ========== */
h1, p {text-align: center;}
.create-patch-btn {display: block; margin: 2rem auto; padding: 12px 22px; font-size: 1rem; font-weight: 700; font-family: "Lato",sans-serif; border-radius: 8px; border: none; text-decoration: none; cursor: pointer; background: #0dd62e; color: white; transition: 0.2s;}
.create-patch-btn:hover {background: #0e9325f1;}
.modal {position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 500;}
.modal-content {background: #16171c; padding: 2rem; width: min(800px, 90%); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);}
.modal-content h2 {margin-bottom: 1rem;}
#patchTitle {width: 100%; padding: 10px; margin-bottom: 1rem; font-size: 1.1rem; border-radius: 6px; border: none;}
.modal-actions {display: flex; justify-content: flex-end; gap: 12px; margin-top: 1rem;}
.btn-primary {background: #41f65f; color: white; border: none; padding: 10px 18px; border-radius: 6px; font-weight: 700; cursor: pointer;}
.btn-primary:hover {background: #22a938;}
.btn-secondary {background: #333; color: white; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer;}
.btn-secondary:hover {background: #444;}

#patch-notes-list {max-width: 90%; margin: 3rem auto; display: flex; flex-direction: column; gap: 2rem;}
.patch-note-card {background: #16171c; border-radius: 14px; padding: 2rem 2.2rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); border: 1px solid #222;}

.patch-note-card.latest {border: 1px solid #41f65f; position: relative;}
.patch-note-card.latest::after {content: "LATEST"; position: absolute; top: 14px; right: 14px; background: #41f65f; color: #000; font-size: 0.7rem; font-weight: 800; padding: 4px 8px; border-radius: 6px;}
.patch-note-card.pinned {border: 1px solid #ba0e0e; position: relative;}
.patch-note-card.pinned::before {content: "PINNED"; position: absolute; top: 14px; right: 14px; background: #ba0e0e; color: #000; font-size: 0.7rem; font-weight: 800; padding: 4px 8px; border-radius: 6px;}

.patch-note-header {display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.4rem;}
.patch-note-header h2 {margin: 0; font-size: 1.6rem; font-weight: 800; color: #ffffff;}
.patch-note-header .date {font-size: 0.9rem; color: #9aa0a6; white-space: nowrap;}
.patch-note-content {text-align: left; color: #e0e0e0; line-height: 1.7; font-size: 1rem;}
.patch-note-content p {margin: 0.6rem 0 1rem; text-align: left;}
.patch-note-content ul {margin: 0.8rem 0 1.2rem 1.4rem; padding-left: 1rem;}
.patch-note-content li {margin-bottom: 0.5rem;}
.patch-note-content code {background: #1e1f25; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.95rem;}
.patch-note-content pre {background: #1e1f25; padding: 1rem; border-radius: 8px; overflow-x: auto; margin: 1.2rem 0;}

.patch-note-actions {margin-top: 1.2rem; text-align: right;}
.pin-btn {background: #333; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 700; color: #555;}
.pin-btn:hover {background: #ba0e0e; color: #000;}
.delete-btn {background: #333; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 700; color: #555; margin-left: 8px;}
.delete-btn:hover {background: #ff3b3b; color: white;}
.edit-btn {background: #333; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 700; color: #555; margin-left: 8px;}
.edit-btn:hover {background: #ffbf00da; color: black;}

.patch-notes-toolbar {max-width: 90%; margin: 2rem auto 1.5rem; display: flex; gap: 1rem; align-items: center;}
#patchSearch {flex: 1; padding: 10px 14px; border-radius: 8px; border: 1px solid #222; background: #16171c; color: white; font-size: 0.95rem;}
#patchSearch::placeholder {color: #888;}
.pin-filter {font-size: 0.9rem; color: #ccc; display: flex; gap: 6px; align-items: center; cursor: pointer;}

/* ========== FOOTERS ========== */
.footer-cta {background: #16171c; padding: 4rem 2rem; text-align: center; color: white;}
.footer-cta h2 {font-size: 2.4rem; font-weight: 700; margin-bottom: 2rem;}
.footer-cta .cta-btn {display: inline-block; background: #fff; color: #4c6fff; padding: 14px 26px; border-radius: 10px; font-weight: 700; font-size: 1rem; text-decoration: none; transition: .2s;}
.footer-cta .cta-btn:hover {transform: translateY(-2px); opacity: .9;}

.footer {background: #16171c; padding: 4rem 2rem 2rem;}
.footer-inner {max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 4rem;}
.footer-brand img {height: 60px; margin-bottom: 1.2rem;}
.footer-brand p {max-width: 260px; color: #cfcfcf; margin-bottom: 1.4rem; line-height: 1.5;}
.footer-links {display: flex; gap: 4rem;}
.footer-col h4 {margin-bottom: 1rem; font-weight: 700; font-size: 1.05rem;}
.footer-col a {display: block; text-decoration: none; color: #cfcfcf; margin-bottom: .55rem; font-size: .9rem; transition: .2s;}
.footer-col a:hover {color: #fff;}
.footer-bottom {text-align: center; color: #636363; padding-top: 2rem; margin-top: 2rem; border-top: 1px solid #232427; font-size: .85rem;}

/* ========== RESPONSIVE ========== */
@media(max-width:1010px){
  .nav-center, .premium-btn, .brand { display:none; }
  .hamburger { display:flex; }

  .feature-block {margin: 4rem 1rem;}
  .feature-block, .feature-block.alt {flex-direction: column; text-align: center;}
  .feature-media {max-width: 90%;}
  .feature-text {order: 1;}
  .feature-media {order: 2;}
  .feature-media img {max-width: 90%; margin: 0 auto;}

  .footer-inner {flex-direction: column; text-align: center;}
  .footer-links {flex-direction: column; gap: 2rem;}
  .footer-brand p {margin: 0 auto;}

  .patch-note-card {padding: 1.5rem;}
  .patch-note-header {flex-direction: column; align-items: flex-start;}
  .patch-note-header h2 {font-size: 1.4rem;}

  .patch-notes-toolbar {flex-direction: column; align-items: stretch;}
}