:root {
  --primary-color: #4f46e5;
  --secondary-color: #10b981;
  --dark-color: #1e293b;
  --light-color: #f8fafc;
  --gray-color: #94a3b8;
  --transition: all 0.3s ease;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --border-radius: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f1f5f9;
  color: var(--dark-color);
  line-height: 1.6;
  overflow-x: hidden;
  user-select: none;
  word-wrap: break-word;
  hyphens: auto;
}

a {
  text-decoration: none;
  color: white;
  word-break: break-all;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color), #7c3aed);
  color: white;
  padding: 40px;
  border-radius: var(--border-radius);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  width: 100%;
}

header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: rotate(30deg);
  animation: shine 8s infinite linear;
}

@keyframes shine {
  0% {
    transform: rotate(30deg) translate(-10%, -10%);
  }
  100% {
    transform: rotate(30deg) translate(10%, 10%);
  }
}

.header-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  width: 100%;
}

.profile-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  flex-shrink: 0;
}

.profile-img:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.header-text {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
  word-wrap: break-word;
}

.title {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
  font-weight: 400;
  word-wrap: break-word;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  list-style: none;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 15px;
  border-radius: 30px;
  backdrop-filter: blur(5px);
  transition: var(--transition);
  min-width: 0;
  flex-shrink: 1;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.contact-item i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-item a,
.contact-item span {
  word-break: break-all;
  overflow-wrap: break-word;
  min-width: 0;
}

/* Main */
.main-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
  width: 100%;
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  min-width: 0;
}

.card {
  background: white;
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 10px;
  word-wrap: break-word;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--secondary-color);
  border-radius: 3px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.skill {
  background: var(--light-color);
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: default;
  word-break: keep-all;
  white-space: nowrap;
  flex-shrink: 0;
}

.skill:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

.language-item {
  margin-bottom: 15px;
}

.language-name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  word-wrap: break-word;
}

.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.progress {
  height: 100%;
  background: var(--primary-color);
  border-radius: 4px;
  transition: width 1.5s ease;
}

.code-container {
  background: #1e293b;
  border-radius: var(--border-radius);
  overflow-x: auto; 
  max-width: 100%;
}

.code-container pre {
  margin: 0;
  font-family: "Courier New", monospace;
  color: #e2e8f0;
  line-height: 1.3;
  white-space: pre-wrap; 
  word-break: break-all; 
  overflow-wrap: break-word;
}

.code-container code {
  font-size: 13px; 
  font-family: inherit;
}

/* Main */
.main-section {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  min-width: 0;
}

.experience-item,
.education-item {
  margin-bottom: 25px;
  position: relative;
  padding-left: 30px;
  word-wrap: break-word;
}

.experience-item::before,
.education-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--secondary-color);
}

.experience-item::after,
.education-item::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: -25px;
  width: 1px;
  background: var(--gray-color);
  opacity: 0.5;
}

.experience-item:last-child::after,
.education-item:last-child::after {
  display: none;
}

.job-title,
.degree {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--dark-color);
  word-wrap: break-word;
}

.company,
.university {
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 5px;
  font-weight: 500;
  word-wrap: break-word;
}

.date {
  font-size: 0.9rem;
  color: var(--gray-color);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.date i {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.description {
  font-size: 0.95rem;
  color: var(--dark-color);
  opacity: 0.9;
  word-wrap: break-word;
}

.description ul {
  padding-left: 20px;
}

.description li {
  margin-bottom: 5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

.project-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  width: 100%;
  min-width: 0;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.certificate {
  height: 220px;
  width: 100%;
  border-radius: var(--border-radius);
  object-fit: cover;
  transition: var(--transition);
}

.certificate:hover {
  transform: scale(1.05);
}

.project-image {
  height: 180px;
  width: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

.project-content {
  padding: 20px;
  word-wrap: break-word;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--dark-color);
  word-wrap: break-word;
  line-height: 1.3;
}

.project-description {
  font-size: 0.9rem;
  color: var(--gray-color);
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.tech-tag {
  background: var(--light-color);
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  word-break: normal;
}

.project-link:hover {
  color: var(--secondary-color);
}

.project-link i {
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 0;
  margin-top: 50px;
  color: var(--gray-color);
  font-size: 0.9rem;
  word-wrap: break-word;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  color: var(--primary-color);
  box-shadow: var(--shadow);
  transition: var(--transition);
  flex-shrink: 0;
}

.social-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.rs-school-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 50px;
  background: transparent;
  transition: var(--transition);
  flex-shrink: 0;
}

.rs-school-logo:hover {
  transform: translateY(-3px);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate {
  opacity: 0;
  transform: translateY(20px);
  animation: none;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

/* Dark Mode */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle i {
  font-size: 1.2rem;
  color: var(--dark-color);
}

body.dark-mode {
  background-color: #0f172a;
  color: #e2e8f0;
}

body.dark-mode .card,
body.dark-mode .social-link {
  background-color: #1e293b;
  color: #e2e8f0;
}

body.dark-mode .skill {
  background-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .skill:hover {
  background: var(--primary-color);
}

body.dark-mode .progress-bar {
  background-color: #334155;
}

body.dark-mode .project-card {
  background-color: #1e293b;
}

body.dark-mode .project-title {
  color: #e2e8f0;
}

body.dark-mode .theme-toggle {
  background-color: #1e293b;
}

body.dark-mode .theme-toggle i {
  color: #e2e8f0;
}

body.dark-mode .description {
  color: var(--light-color);
}

body.dark-mode .job-title,
body.dark-mode .degree {
  color: var(--light-color);
}

body.dark-mode .tech-tag {
  background: #334155;
}

body.dark-mode .rs-school-logo {
  filter: invert(1);
}

/* Print */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .card,
  .project-card {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }
  .theme-toggle,
  .project-links {
    display: none !important;
  }
  a {
    text-decoration: none !important;
    color: black !important;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 15px;
  }

  header {
    padding: 20px;
  }

  .main-section,
  .sidebar {
    align-items: center;
    width: 100%;
  }

  .code-container {
    padding: 15px;
    font-size: 11px;
  }

  .code-container code {
    font-size: 11px;
  }

  h1 {
    line-height: 1.2;
    font-size: 2rem;
  }

  section {
    width: 100%;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .profile-img {
    width: 150px;
    height: 150px;
    margin: 0 auto;
  }

  .contact-info {
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .contact-item {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .main-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card {
    padding: 15px;
  }

  .skill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  footer {
    animation: fadeIn 1s ease forwards !important;
    padding: 20px 0;
  }

  .social-links {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .header-content {
    gap: 15px;
  }

  .contact-info {
    gap: 8px;
  }

  .contact-item {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .card {
    padding: 12px;
  }

  .code-container {
    padding: 10px;
    font-size: 10px;
  }

  .code-container code {
    font-size: 12px;
  }
}

/* Menu */
.side-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
}

.side-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 0;
  margin: 0;
}

.side-nav li {
  position: relative;
}

.side-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 1.2rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
  word-break: normal;
}

.side-nav a:hover {
  background: var(--secondary-color);
  transform: scale(1.1);
}

/* Tooltips */
.side-nav a::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dark-color);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  pointer-events: none;
}

.side-nav a:hover::after {
  opacity: 1;
  visibility: visible;
  right: 70px;
}

@media (max-width: 768px) {
  .side-nav {
    bottom: 20px;
    top: auto;
    right: 50%;
    transform: translateX(50%);
  }

  .side-nav ul {
    flex-direction: row;
    gap: 10px;
  }

  .side-nav a {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .side-nav a::after {
    top: auto;
    bottom: 60px;
    right: 50%;
    transform: translateX(50%);
  }

  .side-nav a:hover::after {
    bottom: 70px;
    right: 50%;
  }
}

body.dark-mode .side-nav a {
  background: var(--dark-color);
  color: var(--light-color);
}

body.dark-mode .side-nav a:hover {
  background: var(--secondary-color);
}

body.dark-mode .side-nav a::after {
  background: var(--light-color);
  color: var(--dark-color);
}
