:root {
  --bg: #f9f9f9;
  --card: #ffffff;
  --text: #222;
  --muted: #555;
  --accent: #0078d7;
  --border: #ddd;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
}

[data-theme="dark"] {
  --bg: #0b0f14;
  --card: #111722;
  --text: #e6eaf0;
  --muted: #9aa4b2;
  --accent: #4fc3f7;
  --border: #1c2533;
  --success: #66bb6a;
  --warning: #ffb74d;
  --danger: #ef5350;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-group {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  border-radius: 5px;
  font-size: 14px;
  transition: all 0.3s ease;
  font-weight: 500;
  min-width: fit-content;
  transform: translateZ(0);
}

button:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px) translateZ(0);
}

.lang-btn,
.theme-btn {
  width: 100px;
  text-align: center;
}

.pdf-btn,
.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  min-width: 45px;
}

.pdf-btn i,
.search-btn i {
  display: inline;
}

.pdf-btn span,
.search-btn span {
  display: inline;
}

/* Search Bar */
.search-bar {
  padding: 15px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.search-bar input {
  width: 100%;
  max-width: 500px;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 215, 0.1);
}

.hidden {
  display: none !important;
}

/* Container */
.container {
  max-width: 900px;
  margin: auto;
  padding: 30px 20px;
}

/* Header */
header {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--border);
}

.header-content {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  text-align: right;
}

.profile-image-wrapper {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.2);
  transition: all 0.3s ease;
}

.profile-image:hover {
  transform: scale(1.05) translateZ(0);
  box-shadow: 0 6px 20px rgba(0, 120, 215, 0.3);
}

.header-text {
  flex: 1;
}

header h1 {
  font-size: 32px;
  margin: 0 0 10px 0;
  color: var(--accent);
}

header p {
  margin: 5px 0;
  font-size: 16px;
  color: var(--muted);
}

header ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 15px;
}

header ul li {
  font-size: 14px;
}

header ul a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s;
}

header ul a:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* Sections */
section {
  margin-bottom: 40px;
}

section h2 {
  font-size: 24px;
  margin: 0 0 20px 0;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
}

section p {
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 15px;
}

/* Skills Container */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.skill-category {
  background: var(--card);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  contain: layout;
}

.skill-category:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px) translateZ(0);
}

.skill-category h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: var(--accent);
  font-weight: 600;
}

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

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 500;
}

.skill-name span:last-child {
  color: var(--accent);
  font-weight: 600;
}

.skill-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #00d4ff);
  transition: width 0.6s ease;
  border-radius: 4px;
  will-change: width;
  transform: translateZ(0);
}

/* Certifications */
.certifications-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.certification-card {
  background: var(--card);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  transition: all 0.3s ease;
}

.certification-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateX(5px) translateZ(0);
}

.certification-card h3 {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.certification-card p {
  margin: 3px 0;
  font-size: 13px;
  color: var(--muted);
}

.certification-card a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  margin-top: 8px;
  display: inline-block;
}

.certification-card a:hover {
  text-decoration: underline;
}

/* Education & Experience */
.education-item,
.experience-item {
  background: var(--card);
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  transition: all 0.3s ease;
}

.education-item:hover,
.experience-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateX(5px) translateZ(0);
}

.education-item h3,
.experience-item h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: var(--accent);
  font-weight: 600;
}

.education-item p,
.experience-item p {
  margin: 5px 0;
  font-size: 14px;
  color: var(--muted);
}

.details-text {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text);
}

.achievements {
  margin-top: 10px;
  padding-left: 20px;
}

.achievements li {
  margin: 5px 0;
  font-size: 14px;
  color: var(--text);
}

/* Languages */
#languages {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

#languages li {
  background: var(--card);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-align: center;
  font-weight: 500;
  transition: all 0.3s ease;
}

#languages li:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 120, 215, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding: 35px 25px;
  }

  .skills-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .profile-image-wrapper {
    justify-content: center;
  }

  header ul {
    justify-content: center;
  }

  header h1 {
    font-size: 24px;
  }

  header ul {
    flex-direction: column;
    gap: 10px;
  }

  .controls {
    padding: 10px;
    gap: 6px;
  }

  .control-group {
    width: 48%;
    justify-content: space-between;
  }

  section h2 {
    font-size: 20px;
  }

  .skills-container {
    grid-template-columns: 1fr;
  }

  .certifications-container {
    grid-template-columns: 1fr;
  }

  button {
    min-height: 44px;
    padding: 10px 12px;
  }

  .search-bar input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px 10px;
  }

  .profile-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
  }

  header h1 {
    font-size: 20px;
  }

  header p {
    font-size: 14px;
  }

  section h2 {
    font-size: 18px;
  }

  .education-item,
  .experience-item {
    padding: 15px;
  }

  .education-item h3,
  .experience-item h3 {
    font-size: 14px;
  }

  .controls {
    flex-direction: column;
    gap: 6px;
    padding: 8px;
  }

  .control-group {
    width: 100%;
    justify-content: center;
  }

  button {
    width: 100%;
    font-size: 12px;
    padding: 10px 8px;
    min-height: 44px;
  }

  .lang-btn,
  .theme-btn {
    width: 100%;
  }

  .skills-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .skill-category {
    padding: 15px;
  }

  #languages {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 320px) {
  .container {
    padding: 10px;
  }

  .profile-image {
    width: 100px;
    height: 100px;
  }

  header h1 {
    font-size: 18px;
  }

  header p {
    font-size: 13px;
  }

  section h2 {
    font-size: 16px;
  }

  button {
    font-size: 11px;
    padding: 8px 6px;
  }

  .controls {
    gap: 4px;
    padding: 6px;
  }

  .search-bar {
    padding: 10px 8px;
  }

  .search-bar input {
    font-size: 13px;
    padding: 8px 10px;
  }
}

/* Print Styles */
@media print {
  .controls,
  .search-bar {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .container {
    max-width: 100%;
    padding: 20px;
  }

  section {
    page-break-inside: avoid;
  }

  header {
    border-bottom: 1px solid #ddd;
  }

  button {
    display: none;
  }

  .profile-image {
    border-color: black;
  }
}