/* 
   Trends4You Main Stylesheet 
   Theme: Dark Cybersecurity Aesthetic (Teal/Purple/Magenta)
*/

:root {
  /* Color Palette */
  --bg-dark: #0a0a12;
  --bg-card: #14141f;
  --bg-card-hover: #1c1c2e;
  --text-primary: #ffffff;
  --text-secondary: #b0b0c0;
  --accent-teal: #00f2ea;
  --accent-purple: #8a2be2;
  --accent-magenta: #ff0055;
  --border-color: #2a2a3a;
  
  /* Gradients */
  --gradient-main: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
  --gradient-border: linear-gradient(90deg, var(--accent-teal), var(--accent-magenta));
  
  /* Layout */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

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

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

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.social-icons img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: inline-block;
}

/* --- Typography --- */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  margin-bottom: 1rem;
}

h1 { font-size: 3rem; letter-spacing: -1px; }
h2 { font-size: 2.5rem; color: var(--accent-teal); }
h3 { font-size: 1.5rem; }

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Components --- */

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 242, 234, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent-teal);
  color: var(--accent-teal);
}

.btn-outline:hover {
  background: rgba(0, 242, 234, 0.1);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-purple);
}

/* --- Code Blocks --- */
pre {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  max-width: 100%;
  overflow-x: auto;        /* allow horizontal scroll if really needed */
  white-space: pre-wrap;   /* allows wrapping in <pre> */
  word-wrap: break-word;   /* older name, but helps */
}

pre code {
  white-space: pre-wrap;   /* match pre so lines can wrap */
  font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
  font-size: 0.9rem;
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Section Spacing */
section {
  padding: 4rem 0;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}
.badge-critical { background: var(--accent-magenta); color: #fff; }
.badge-warning { background: #ffaa00; color: #000; }
.badge-info { background: var(--accent-teal); color: #000; }

/* --- Navigation --- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 18, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo img {
  height: 50px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: var(--accent-magenta);
  transition: width 0.3s;
}

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

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  height: 80vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  background: radial-gradient(circle at top right, rgba(138, 43, 226, 0.15), transparent 40%),
              radial-gradient(circle at bottom left, rgba(0, 242, 234, 0.1), transparent 40%);
}

.hero-content {
  max-width: 600px;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

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

.hero-buttons {
  display: flex;
  gap: 1rem;
}

/* --- Ticker --- */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.8rem 0;
  white-space: nowrap;
}

.ticker {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 30s linear infinite;
}

.ticker-item {
  display: inline-block;
  padding: 0 2rem;
  font-size: 0.9rem;
  color: var(--accent-teal);
}

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* --- Carousel --- */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-top: 2rem;
  height: 400px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 1rem;
  cursor: pointer;
  z-index: 10;
  font-size: 1.5rem;
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

/* --- Dashboard Grid (Index) --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

/* Vertical Scrolling Updates */
.updates-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  height: 500px;
  display: flex;
  flex-direction: column;
}

.updates-header {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filters button {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
}

.filters button.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
}

.scroll-list {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom Scrollbar */
.scroll-list::-webkit-scrollbar {
  width: 6px;
}
.scroll-list::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.update-item {
  background: rgba(255,255,255,0.03);
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.update-item.type-cve { border-color: var(--accent-magenta); }
.update-item.type-ms { border-color: var(--accent-teal); }

/* --- Services Grid --- */
.services-grid, .resources-grid, .blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent-teal);
}

/* --- Resources Page --- */
.learning-path {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.path-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card-hover);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  position: relative;
}

.path-step::before {
  content: '';
  position: absolute;
  left: 24px;
  top: -20px;
  width: 2px;
  height: 20px;
  background: var(--border-color);
}
.path-step:first-child::before { display: none; }

.step-number {
  background: var(--accent-purple);
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-weight: bold;
  flex-shrink: 0;
}

/* --- About Timeline --- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background: var(--border-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
}

.timeline-item.left { left: 0; text-align: right; }
.timeline-item.right { left: 50%; }

.timeline-content {
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* --- Newsletter --- */
.newsletter-section {
  background: linear-gradient(to right, #161622, #0d0d15);
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.newsletter-form {
  max-width: 500px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group input {
  width: 100%;
  padding: 1rem;
  background: #0a0a12;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-sm);
}

.checkbox-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Footer --- */
footer {
  background: #050508;
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
}

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

.footer-logo img {
  height: 40px;
  margin-bottom: 1rem;
}

.social-icons a {
  display: inline-block;
  margin-right: 1rem;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.social-icons a:hover {
  color: var(--accent-magenta);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--bg-card);
    flex-direction: column;
    padding: 2rem;
    transition: transform 0.3s ease;
    border-left: none;
    transform: translateX(100%); /* hidden off-screen to the right */
  }

  .nav-links.active {
    transform: translateX(0); /* slide into view */
  }

  .mobile-toggle {
    display: block;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .timeline::after { left: 31px; }
  .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
  .timeline-item.left { left: 0; text-align: left; }
  .timeline-item.right { left: 0; }

  .update-item.type-cve {
    border: 2px solid red !important;
    background: rgba(255,0,0,0.1) !important;
  }
}

