/* --- Variables & Reset --- */
:root {
  --bg-color: #0f172a;
  /* Deep modern blue-black */
  --card-bg: #1e293b;
  /* Lighter slate for cards */
  --text-primary: #f8fafc;
  /* Off-white */
  --text-secondary: #94a3b8;
  /* Muted gray-blue */
  --accent-color: #38bdf8;
  /* Bright Cyan/Blue */
  --accent-hover: #0ea5e9;
  --font-main: 'Roboto', sans-serif;
  --font-code: 'Courier New', Courier, monospace;
  /* For developer feel */
  --nav-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
}

/* --- Typography --- */
h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

/* --- Header & Nav --- */
header {
  background: rgba(15, 23, 42, 0.85);
  /* Semi-transparent */
  backdrop-filter: blur(10px);
  /* Glass blur effect */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  height: 32px;
  /* Sleeker size */
  display: block;
}

/* Desktop Nav Links */
.nav-center {
  display: flex;
  gap: 30px;
}

.nav-center a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}

.nav-center a:hover,
.nav-center a.active-link {
  color: var(--accent-color);
}

/* Underline animation */
.nav-center a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-center a:hover::after,
.nav-center a.active-link::after {
  width: 100%;
}

/* Right Side Icons */
.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-icon {
  font-size: 1.4rem;
  color: var(--text-secondary);
}

.social-icon:hover {
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 100%;
  background: var(--card-bg);
  flex-direction: column;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(-150%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  z-index: 999;
}

.mobile-nav.active {
  transform: translateY(0);
}

.mobile-nav a {
  padding: 15px 30px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.mobile-nav a:hover,
.mobile-nav a.active-link {
  color: var(--accent-color);
  background: rgba(255, 255, 255, 0.03);
}

/* --- Layout Main --- */
main {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  min-height: 80vh;
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 120px 20px;
  /* Updated gradient to match modern theme */
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0) 70%);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.button {
  display: inline-block;
  background-color: var(--accent-color);
  color: #0f172a;
  /* Dark text on bright button for contrast */
  padding: 12px 32px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, background-color 0.2s;
}

.button:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

/* --- Grids (Projects & Guides) --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  padding-bottom: 40px;
}

.project-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
  border-color: rgba(56, 189, 248, 0.3);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card-content {
  padding: 25px;
}

.project-card-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.project-card-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Contact Form (Centralized) --- */
.contact-container {
  max-width: 600px;
  margin: 60px auto;
  background: var(--card-bg);
  padding: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-container h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--accent-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.btn-submit {
  width: 100%;
  background: var(--accent-color);
  color: #0f172a;
  border: none;
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: var(--accent-hover);
}

/* --- Responsive --- */
@media (max-width: 768px) {

  .nav-center,
  .nav-right .social-icon {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .hero h1 {
    font-size: 2.5rem;
  }
}

/* --- Documentation / Guide Styles --- */

.hero-small {
  text-align: center;
  padding: 80px 20px 40px;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.05) 0%, rgba(15, 23, 42, 0) 70%);
}

.hero-small h1 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.guide-container {
  max-width: 900px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.guide-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.guide-section h2 {
  font-size: 1.8rem;
  color: var(--accent-color);
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-block {
  margin-bottom: 25px;
}

.guide-block h3 {
  font-size: 1.2rem;
  color: #e2e8f0;
  margin-bottom: 10px;
}

/* Lists */
.detail-list,
.step-list,
.command-list {
  color: var(--text-secondary);
  padding-left: 20px;
}

.detail-list li,
.step-list li,
.command-list li {
  margin-bottom: 8px;
}

.detail-list strong {
  color: var(--text-primary);
}

/* Code Styling */
code {
  font-family: var(--font-code);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: #a5b4fc;
  /* Soft purple/blue for code */
  font-size: 0.9em;
}

.code-copy-wrapper {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.code-copy-wrapper span {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-copy-wrapper code {
  color: var(--accent-color);
  background: none;
  padding: 0;
  font-size: 1rem;
}

/* Alert Boxes */
.alert-box {
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 25px;
  border-left: 4px solid;
}

.alert-box.warning {
  background: rgba(220, 38, 38, 0.1);
  /* Red tint */
  border-color: #ef4444;
  color: #fca5a5;
}

.alert-box.info {
  background: rgba(56, 189, 248, 0.1);
  /* Blue tint */
  border-color: var(--accent-color);
  color: var(--text-secondary);
}

/* Keyboard Keys */
kbd {
  background-color: #334155;
  border-radius: 3px;
  border: 1px solid #475569;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  color: #f8fafc;
  display: inline-block;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
}

/* Fix for mobile code overflow - Safari/iOS Optimized */
.code-copy-wrapper {
  width: 100%;
  /* Force container to fill width */
  max-width: 100%;
  /* Prevent exceeding parent */
  overflow-x: hidden;
  /* Hide horizontal scrollbar if it appears */
}

.code-copy-wrapper code {
  white-space: pre-wrap;
  /* Preserves formatting but allows wrapping */
  word-wrap: break-word;
  /* Legacy support */
  overflow-wrap: break-word;
  /* Standard wrapping */
  overflow-wrap: anywhere;
  /* Crucial for Safari to break long URLs */
  word-break: break-all;
  /* Force breaks within words if necessary */
  display: block;
  /* Ensure block formatting context */
  font-size: 0.9em;
  /* Slight reduction for better mobile fit */
}

/* --- Footer --- */
footer {
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 60px 20px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.footer-section p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-section a {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

/* Security "Pop-in" Animation */
.requires-family,
.requires-admin,
.requires-friends {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

/* --- Authentication System Styles --- */
.auth-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.login-btn {
  background: var(--accent-color);
  /* Uses your Cyan/Blue */
  color: #0f172a;
  /* Dark text for contrast */
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s, background 0.2s;
}

.login-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.user-badge {
  display: none;
  /* Hidden by default */
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.user-badge.active {
  display: flex;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #2ecc71;
  /* Green for active */
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* --- Protected Card Styles --- */
/* By default, locked cards are hidden */
.project-card.locked {
  display: none !important;
  opacity: 0;
}

.project-card.unlocked {
  display: block !important;
  opacity: 1;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badges for the cards */
.card-badge {
  display: inline-block;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.card-badge.family {
  background: #9b59b6;
}

/* Purple */
.card-badge.friends {
  background: #f59e0b;
}

/* Amber/Orange */
.card-badge.admin {
  background: #e74c3c;
}

/* Red */