/* ========================================
   SecurityTools.dev - Complete Stylesheet
   Cybersecurity-themed design with light/dark mode
   ======================================== */

/* ============ CSS Variables ============ */
:root {
  /* Light Theme Colors - Modern 2024-2026 Design */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-card: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --accent-primary: #06B6D4;
  --accent-secondary: #8B5CF6;
  --accent-hover: #0891B2;
  --border-color: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Transition timing */
  --transition-speed: 300ms;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Theme Colors - Modern 2024-2026 Design */
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #1E293B;
  --text-primary: #F8FAFC;
  --text-secondary: #E2E8F0;
  --text-muted: #94A3B8;
  --accent-primary: #22D3EE;
  --accent-secondary: #A78BFA;
  --accent-hover: #06B6D4;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}

/* ============ Base Styles ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-speed) var(--transition-ease), 
              color var(--transition-speed) var(--transition-ease);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed) var(--transition-ease), 
              transform var(--transition-speed) var(--transition-ease);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============ Container ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ Preloader ============ */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent-primary);
  border-right: 4px solid var(--accent-secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============ Header ============ */
header {
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-speed) var(--transition-ease);
  backdrop-filter: blur(10px);
}

header.scrolled {
  box-shadow: var(--shadow-lg);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navigation */
nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a:hover {
  color: var(--accent-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: width var(--transition-speed) var(--transition-ease);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 600px;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.menu-category h4 {
  color: var(--accent-primary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-category ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-category a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  display: block;
}

.menu-category a:hover {
  color: var(--accent-primary);
  padding-left: 0.5rem;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-speed) var(--transition-ease);
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* ============ Hero Section ============ */
.hero {
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  animation: gradient 15s ease infinite;
  z-index: 0;
}

@keyframes gradient {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all var(--transition-speed) var(--transition-ease);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============ Sections ============ */
section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ============ Grid Layouts ============ */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ============ Cards ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  transition: all var(--transition-speed) var(--transition-ease);
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.tool-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tool-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tool-card p {
  color: var(--text-secondary);
  flex-grow: 1;
  margin-bottom: 1rem;
}

.tool-footer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============ Badges ============ */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-category {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.badge-available {
  background: var(--success);
  color: white;
}

.badge-coming-soon {
  background: var(--text-muted);
  color: white;
}

/* ============ Filter Buttons ============ */
.filter-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 25px;
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-ease);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============ Features Grid ============ */
.feature-card {
  text-align: center;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

/* ============ Forms ============ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

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

/* ============ Footer ============ */
footer {
  background: var(--bg-secondary);
  padding: 3rem 0 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.footer-column p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-primary);
  padding-left: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-secondary);
}

/* ============ Back to Top Button ============ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed) var(--transition-ease);
  z-index: 999;
  box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(6, 182, 212, 0.4);
}

/* ============ Responsive Design ============ */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    gap: 0;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-links a {
    display: block;
    padding: 1rem;
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 100%;
    margin-top: 0;
    border: none;
    box-shadow: none;
    padding: 1rem 0;
  }
  
  .mega-menu {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  nav {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 3rem 0;
  }
  
  .hero h1 {
    font-size: 1.5rem;
  }
  
  section {
    padding: 2rem 0;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* ============ Utility Classes ============ */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none;
}
