/* ===== Global Styles ===== */
html {
  scroll-behavior: smooth;
}

body {
  padding-top: 70px;
  transition: background-color 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Theme Styles ===== */
body.light-theme {
  background-color: #fff;
  color: #222;
}

body.dark-theme {
  background-color: #121212;
  color: #ddd;
}

body.dark-theme nav#main-navbar {
  background-color: #1f1f1f !important;
  color: #ddd !important;
}

/* ===== Navigation ===== */
nav#main-navbar {
  height: 70px;
  transition: background-color 0.3s, color 0.3s;
}

nav#main-navbar .container {
  flex-wrap: nowrap !important;
}

nav#main-navbar .nav-link,
nav#main-navbar .navbar-brand {
  color: inherit;
  transition: color 0.3s;
  white-space: nowrap;
}

nav#main-navbar .nav-link:hover,
nav#main-navbar .nav-link:focus {
  color: #007bff;
}

nav#main-navbar.dark-theme .navbar-brand {
  color: #ddd;
}

/* Prevent menu items from wrapping */
nav#main-navbar .navbar-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

nav#main-navbar .navbar-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Switchers container - fixed width to prevent jumping */
.switchers-container {
  width: 140px;
  min-width: 140px;
  justify-content: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  nav#main-navbar .navbar-brand {
    font-size: 1rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .switchers-container {
    position: absolute;
    right: 60px;
    top: 15px;
  }
}

/* ===== Profile Picture ===== */
img#profile-pic {
  max-width: 100%;
  width: 280px;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s;
  margin-top: 20px;
}

body.dark-theme img#profile-pic {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* ===== Buttons (Language & Theme Switchers) ===== */
.lang-btn,
#theme-toggle {
  background: none;
  border: none;
  font-size: 22px;
  margin: 0 5px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
  color: inherit;
  /* Fixed dimensions to prevent jumping */
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border-radius: 8px;
}

/* Language text styling */
.lang-btn .lang-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  user-select: none;
}

.lang-btn:hover,
#theme-toggle:hover {
  transform: scale(1.15);
  background-color: rgba(0, 123, 255, 0.1);
}

.lang-btn:active,
#theme-toggle:active {
  transform: scale(0.95);
}

.lang-btn.active {
  background-color: rgba(0, 123, 255, 0.15);
  border: 2px solid #007bff;
}

/* Dark theme button adjustments */
body.dark-theme .lang-btn:hover,
body.dark-theme #theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .lang-btn.active {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #4dabf7;
}

/* Icon sizing for theme toggle */
#theme-toggle i {
  font-size: 20px;
}


/* ===== Portfolio Cards ===== */
.card-portfolio {
  margin-bottom: 20px;
}

@media (max-width: 767.98px) {
  .card-portfolio {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.card-portfolio .card {
  transition: background-color 0.3s, color 0.3s;
  border-radius: 12px;
}

body.light-theme .card-portfolio .card {
  background-color: #fff;
  color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.dark-theme .card-portfolio .card {
  background-color: #2c2f3a;
  color: #ddd;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

body.dark-theme .card-portfolio .card-title {
  color: #eee;
}

body.dark-theme .card-portfolio .card-text {
  color: #ccc;
}

/* ===== Footer ===== */
footer#contact-footer {
  background: #f8f9fa;
  padding: 15px 0;
  margin-top: auto;
}

body.dark-theme footer#contact-footer {
  background: #1f1f1f;
}

footer#contact-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 1.1rem;
}

footer#contact-footer a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

footer#contact-footer a:hover {
  color: #007bff;
  text-decoration: underline;
}

footer#contact-footer i {
  font-size: 1.3rem;
  min-width: 24px;
  text-align: center;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 575.98px) {
  h1,
  h2,
  h3,
  h4 {
    font-size: 1.3rem;
  }

  #profile-pic {
    width: 100%;
    max-width: 250px;
  }

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

  footer#contact-footer .container {
    flex-direction: column;
    align-items: center;
  }
}

/* ===== Main Content ===== */
main {
  flex-grow: 1;
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
}

.personal-info p {
  margin: 0.2rem 0;
}

/* ===== Icons ===== */
.bi {
  font-family: 'bootstrap-icons' !important;
  font-size: 1.2rem;
  vertical-align: middle;
  margin-right: 5px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== Certificates Section ===== */
#certs {
  min-height: 200px;
}

.certs-placeholder {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

body.dark-theme .certs-placeholder {
  background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.certs-placeholder h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.certs-placeholder p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ===== Section Cards (like Certificates) ===== */
.section-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2.5rem 2rem;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Light theme - light backgrounds with dark text */
body.light-theme .section-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #222;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

body.light-theme .section-card h2,
body.light-theme .section-card h3 {
  color: #222;
}

body.light-theme .section-card p,
body.light-theme .section-card ul,
body.light-theme .section-card li {
  color: #444;
}

body.light-theme .section-card a {
  color: #007bff;
  border-bottom-color: rgba(0, 123, 255, 0.3);
}

body.light-theme .section-card a:hover {
  border-bottom-color: #007bff;
}

/* Dark theme - keep gradients with white text */
body.dark-theme .section-card {
  background: linear-gradient(135deg, #434343 0%, #000000 100%);
  color: white;
}

body.dark-theme .section-card h2,
body.dark-theme .section-card h3 {
  color: white;
}

body.dark-theme .section-card p,
body.dark-theme .section-card ul,
body.dark-theme .section-card li {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-theme .section-card a {
  color: #ffd700;
  border-bottom-color: rgba(255, 215, 0, 0.3);
}

body.dark-theme .section-card a:hover {
  border-bottom-color: #ffd700;
}

.section-card h2 {
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 600;
}

.section-card h3 {
  opacity: 0.95;
}

.section-card p,
.section-card ul,
.section-card li {
  font-size: 1.05rem;
  line-height: 1.6;
}

.section-card ul {
  margin-bottom: 0;
}

.section-card li {
  margin-bottom: 0.8rem;
}

.section-card a {
  text-decoration: none;
  border-bottom: 1px solid;
  transition: border-color 0.3s;
}

/* Different light gradient colors for variety in light theme */
body.light-theme .section-card.gradient-purple {
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

body.light-theme .section-card.gradient-blue {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

body.light-theme .section-card.gradient-pink {
  background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
}

body.light-theme .section-card.gradient-orange {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

body.light-theme .section-card.gradient-green {
  background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

body.light-theme .section-card.gradient-red {
  background: linear-gradient(135deg, #fdcbf1 0%, #e6dee9 100%);
}

/* Dark theme gradients */
body.dark-theme .section-card.gradient-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-theme .section-card.gradient-blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body.dark-theme .section-card.gradient-pink {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body.dark-theme .section-card.gradient-orange {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

body.dark-theme .section-card.gradient-green {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

body.dark-theme .section-card.gradient-red {
  background: linear-gradient(135deg, #ff6a00 0%, #ee0979 100%);
}

/* ===== Skill Bars ===== */
.skills-container {
  max-width: 800px;
  margin: 0 auto;
}

.skill-item {
  margin-bottom: 25px;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
}

.skill-name i {
  margin-right: 8px;
  color: #007bff;
}

body.dark-theme .skill-name i {
  color: #4dabf7;
}

.skill-percent {
  font-weight: 600;
  color: #007bff;
}

body.dark-theme .skill-percent {
  color: #4dabf7;
}

.skill-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

body.dark-theme .skill-bar {
  background: rgba(255, 255, 255, 0.1);
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skill-progress.animate {
  width: var(--skill-percent);
}

/* ===== CTA Section ===== */
#cta {
  padding: 60px 0;
}

.cta-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body.dark-theme .cta-container {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-subtitle {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.8;
}

.cta-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-cta-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-cta-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  color: white;
  text-decoration: none;
}

.btn-cta-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

body.dark-theme .btn-cta-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #4dabf7;
  border-color: #4dabf7;
}

.btn-cta-secondary:hover {
  background: #667eea;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  text-decoration: none;
}

body.dark-theme .btn-cta-secondary:hover {
  background: #4dabf7;
  border-color: #4dabf7;
}

.btn-cta i {
  font-size: 20px;
}

/* ===== Contact Form ===== */
.contact-form-container {
  max-width: 600px;
  margin: 0 auto;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}

.form-group label i {
  margin-right: 8px;
  color: #007bff;
}

body.dark-theme .form-group label i {
  color: #4dabf7;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  color: #222;
}

body.dark-theme .form-control {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ddd;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.dark-theme .form-control:focus {
  border-color: #4dabf7;
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.1);
}

.form-control::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body.dark-theme .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

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

.btn-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
}

.alert-success {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ===== Telegram Float Button ===== */
.telegram-float-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
  box-shadow: 0 4px 20px rgba(0, 136, 204, 0.4);
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
}

.telegram-float-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 30px rgba(0, 136, 204, 0.6);
  color: white;
  text-decoration: none;
}

.telegram-float-btn i {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== Scroll Animations ===== */
.section-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

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

.section-card:nth-child(1) { animation-delay: 0.1s; }
.section-card:nth-child(2) { animation-delay: 0.2s; }
.section-card:nth-child(3) { animation-delay: 0.3s; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .cta-title {
    font-size: 1.8rem;
  }
  
  .cta-subtitle {
    font-size: 1rem;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
  
  .btn-cta {
    width: 100%;
    justify-content: center;
  }
  
  .telegram-float-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}