/* CodeReiver Website Styles */

/* CSS Variables */
:root {
  --primary-color: #1B4332;
  --secondary-color: #2D6A4F;
  --accent-color: #FFD60A;
  --dark-accent: #081C15;
  --text-color: #212529;
  --bg-color: #F8F9FA;
  --card-bg: #FFFFFF;
  --border-color: #DEE2E6;
  --johnstone-blue: #2E4A62;
  --johnstone-green: #2D6A4F;
  --johnstone-gold: #FFD60A;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --primary-color: #40916C;
  --secondary-color: #2D6A4F;
  --accent-color: #FFD60A;
  --dark-accent: #081C15;
  --text-color: #F8F9FA;
  --bg-color: #212529;
  --card-bg: #343A40;
  --border-color: #495057;
  --johnstone-blue: #4A6B85;
  --johnstone-green: #52B788;
  --johnstone-gold: #FFE066;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Cormorant Garamond', serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 60px;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(30, 67, 50, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  z-index: 1000;
  transition: all 0.3s ease;
}

nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 400px;
  background: 
    linear-gradient(to right, transparent 0%, rgba(30, 67, 50, 0.1) 60%, rgba(30, 67, 50, 0.3) 80%, rgba(30, 67, 50, 0.7) 95%, rgba(30, 67, 50, 0.95) 100%),
    url('https://upload.wikimedia.org/wikipedia/commons/a/ae/Johnston%28e%29_Tartan.svg') repeat;
  background-size: 100% 100%, 130px 130px;
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
}

nav.scrolled {
  background: rgba(30, 67, 50, 0.98);
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.nav-logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 1px;
}

.nav-shield {
  width: 40px;
  height: 40px;
  transition: all 0.3s ease;
}

.nav-logo:hover .nav-shield {
  filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(45deg);
}

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

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--accent-color);
  transform: translateY(-2px);
}

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

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

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

.nav-links a.active::after {
  width: 100%;
  background: var(--accent-color);
}

.nav-flags {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.saltire, .northumberland-flag {
  display: flex;
  align-items: center;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.saltire:hover, .northumberland-flag:hover {
  opacity: 1;
  transform: scale(1.1);
}

.saltire svg, .northumberland-flag svg {
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.theme-toggle {
  background: none;
  border: 2px solid white;
  color: white;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.theme-toggle:hover {
  background: white;
  color: var(--primary-color);
  transform: rotate(180deg);
}


/* Single Page App Content */
.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

/* Main Content - Home Page */
.home-content {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

.image-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.eildon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Background Image for Other Pages */
.page-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-color: #1B4332;
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
}

.background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.background-image.loaded {
  opacity: 1;
}


/* Sections */
section {
  padding: 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  flex: 1;
}

/* Content pages need top margin for fixed nav and proper flexbox layout */
section:first-of-type {
  margin-top: 80px;
}

/* Projects section should start at top */
#projects {
  margin-top: 80px;
  padding-top: 1rem;
}

.section-title {
  font-family: 'Cinzel', serif;
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--primary-color);
  position: relative;
  letter-spacing: 1px;
}

.section-title::after {
  content: '';
  width: 100px;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--johnstone-blue) 100%);
  display: block;
  margin: 1rem auto;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* About Section */
.about-grid {
  display: block;
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
}


.about-text {
  animation: fadeInLeft 1s ease;
}

.about-text h3 {
  font-family: 'Cinzel', serif;
  color: var(--secondary-color);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.5px;
}

.about-image {
  animation: fadeInRight 1s ease;
  text-align: center;
}

.about-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
}

.about-image img:hover {
  transform: scale(1.05);
}

/* Services Section */
.services {
  background: var(--card-bg);
  margin: 5rem 0;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.service-card:hover::before {
  left: 100%;
}

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

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

.service-card h3 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* Blog Section */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.blog-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.blog-card-header {
  background: var(--primary-color);
  color: white;
  padding: 1.5rem;
  position: relative;
}

.blog-card-header::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--primary-color);
}

.blog-card-body {
  padding: 2rem;
}

.blog-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.blog-date {
  color: var(--accent-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
}

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

.project-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1.5rem;
  position: relative;
}

.project-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: url('https://upload.wikimedia.org/wikipedia/commons/a/ae/Johnston%28e%29_Tartan.svg') repeat;
  background-size: 130px 130px;
  opacity: 0.15;
  z-index: 1;
  pointer-events: none;
}

.project-header::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 15px solid var(--secondary-color);
}

.project-header h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
}

.project-tech {
  font-size: 0.85rem;
  opacity: 0.9;
  font-style: italic;
  position: relative;
  z-index: 2;
}

.project-body {
  padding: 2rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-body p {
  margin-bottom: 1.2rem;
  line-height: 1.5;
  flex: 1;
  font-size: 1rem;
}

.project-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.feature-tag {
  background: var(--primary-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.feature-tag:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-color);
  color: white;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.project-link:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.project-link.disabled {
  background: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Links Section */
.simple-links-container {
  background: white;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.simple-links-container h2 {
  font-family: 'Cinzel', serif;
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.simple-links-container ul {
  margin-bottom: 2rem;
  padding-left: 2rem;
}

.simple-links-container li {
  margin-bottom: 0.5rem;
}

.simple-links-container a {
  color: var(--secondary-color);
  text-decoration: none;
}

.simple-links-container a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.contact-item:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow-lg);
}

.contact-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  min-width: 2rem;
}

.contact-form {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  background: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.submit-btn {
  background: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.submit-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

/* Footer */
footer {
  background: var(--secondary-color) url('https://upload.wikimedia.org/wikipedia/commons/a/ae/Johnston%28e%29_Tartan.svg') repeat;
  background-size: 150px 150px;
  color: white;
  text-align: center;
  padding: 1rem;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(45, 106, 79, 0.1) 10%, rgba(45, 106, 79, 0.5) 30%, rgba(45, 106, 79, 0.7) 100%);
  z-index: 1;
}

footer > * {
  position: relative;
  z-index: 2;
}

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

.footer-section h3 {
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.footer-section a {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.social-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--accent-color);
  transform: translateY(-3px);
}

/* Animations */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .about-grid {
    margin: 2rem auto 0;
  }

  .about-grid::before {
    top: -1rem;
    left: -1rem;
    right: -1rem;
    bottom: -1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  section {
    padding: 3rem 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

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

@media (max-width: 480px) {
  .nav-links {
    gap: 1rem;
  }
}