/* CSS Variables for themes */
:root {
  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --accent-primary: #dc3545; /* Red from the logo */
  --accent-secondary: #ff6b6b;
  --border-color: #e9ecef;
  --card-bg: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
}

:root[data-theme="dark"] {
  /* Dark theme colors */
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent-primary: #ff6b6b; /* Lighter red for better contrast */
  --accent-secondary: #ff8e8e;
  --border-color: #333333;
  --card-bg: #252525;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.4);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and Navigation */
.header {
  background-color: var(--bg-primary);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.navbar {
  padding: 1rem 0;
}

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

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

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

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  white-space: nowrap;
  font-size: 0.95rem;
}

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

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

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

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.4rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--bg-secondary);
  color: var(--accent-primary);
}

/* Language Switcher */
.language-switcher-container {
  position: relative;
}

.language-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-toggle:hover {
  background-color: var(--bg-secondary);
}

.current-flag {
  display: inline-block;
  font-size: 1.3rem;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  border: 1px solid var(--border-color);
}

.language-dropdown.show {
  display: block;
  animation: fadeInDown 0.3s ease;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
  text-align: left;
}

.language-option:hover {
  background-color: var(--bg-secondary);
}

.language-option.active {
  background-color: var(--accent-primary);
  color: white;
}

.language-option.active:hover {
  background-color: var(--accent-secondary);
}

.lang-flag {
  font-size: 1.3rem;
  min-width: 24px;
}

.lang-name {
  flex: 1;
}

/* Scrollbar styling for language dropdown */
.language-dropdown::-webkit-scrollbar {
  width: 6px;
}

.language-dropdown::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 10px;
}

.language-dropdown::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 10px;
}

.language-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* RTL Support */
[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .language-dropdown {
  right: auto;
  left: 0;
}

[dir="rtl"] .nav-menu {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-buttons {
  flex-direction: row-reverse;
}

/* Animation for dropdown */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  margin: 3px 0;
  transition: 0.3s;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 4rem 20px;
  text-align: center;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  z-index: 2;
  position: relative;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1s ease;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 1s ease 0.4s both;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

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

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

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

/* Floating elements animation */
.floating-element {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

.element-1 {
  width: 200px;
  height: 200px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.element-2 {
  width: 150px;
  height: 150px;
  bottom: 20%;
  right: 10%;
  animation-delay: 2s;
}

.element-3 {
  width: 100px;
  height: 100px;
  top: 50%;
  right: 30%;
  animation-delay: 4s;
}

/* Sections */
.section {
  padding: 6rem 0;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
}

.section-title::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 4px;
  background-color: var(--accent-primary);
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

/* About Section */
.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.about-text p {
  margin-bottom: 1.5rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat {
  padding: 1.5rem;
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.stat:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.service-card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

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

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.service-card p {
  color: var(--text-secondary);
}

/* Portfolio Section */
.portfolio-intro {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: -1rem auto 3rem;
  line-height: 1.6;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.portfolio-item {
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.portfolio-image {
  height: 200px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-logo {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.portfolio-item:hover .project-logo {
  transform: scale(1.05);
}

.project-placeholder {
  background-color: rgba(255, 255, 255, 0.1);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  font-weight: bold;
}

.portfolio-content {
  padding: 1.5rem;
}

.portfolio-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.project-tech {
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.project-tech i {
  font-size: 1rem;
}

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

.project-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.project-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  padding: 0.5rem 0;
}

.project-link:hover {
  color: var(--accent-secondary);
  gap: 0.75rem;
}

.project-link i {
  font-size: 1.1rem;
}

/* Contact Section */
.contact-subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem;
  font-size: 1.1rem;
}

.contact-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  max-width: 1000px;
  width: 100%;
}

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

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.contact-item i {
  font-size: 2.5rem;
  color: var(--accent-primary);
  min-width: 3rem;
}

.contact-item h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.contact-item p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.contact-link {
  display: block;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.contact-link:hover {
  color: var(--accent-secondary);
  transform: translateX(5px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

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

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-logo {
  text-align: center;
}

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

.footer-logo p {
  color: var(--text-secondary);
}

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

.footer-section h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  gap: 1rem;
}

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

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

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Responsive Design */
@media screen and (max-width: 1100px) {
  .nav-menu {
    gap: 0.8rem;
  }

  .nav-link {
    font-size: 0.9rem;
  }

  .logo-text {
    font-size: 1.2rem;
  }
}

@media screen and (max-width: 950px) {
  .nav-menu {
    gap: 0.6rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .theme-toggle,
  .language-toggle {
    font-size: 1rem;
    padding: 0.3rem;
  }

  .current-flag {
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 768px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--bg-primary);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: var(--shadow);
    padding: 2rem 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .hamburger {
    display: flex;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

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

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

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

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

  .footer-links {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 480px) {
  .section-title {
    font-size: 2rem;
  }

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

  .hero-buttons {
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}