/* ================================
   Theme Variables
================================= */
:root {
  --bg: #f5f5f5;
  --text: #1c1c1c;
  --accent: #e95420;
  --header-bg: #e0e0e0;
  --footer-bg: #d6d6d6;
  --header-footer-text: #111111;
  --card-bg: rgba(255, 255, 255, 0.7);
  --blur: blur(6px);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg: #000;
  --text: #fff;
  --accent: #ff7e29;
  --header-bg: #111;
  --footer-bg: #1a1a1a;
  --header-footer-text: #ccc;
  --card-bg: rgba(25, 25, 25, 0.7);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* ================================
   Reset & Base
================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Ubuntu', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

main {
  flex: 1;
}

main.blur {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease;
}

/* ================================
   Preloader
================================= */
#preloader {
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================
   Ubuntu Accent Strip
================================= */
.ubuntu-strip {
  height: 4px;
  background-color: var(--accent);
}

/* ================================
   Header
================================= */
.site-header {
  width: 100%;
  background-color: var(--header-bg);
  color: var(--header-footer-text);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .site-header {
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.logo {
  font-size: 1.25rem;
  font-weight: bold;
}

/* ================================
   Ubuntu Theme Toggle
================================= */
.ubuntu-toggle {
  width: 60px;
  height: 30px;
  position: relative;
}

.ubuntu-toggle input {
  display: none;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--header-footer-text);
  border-radius: 999px;
  padding: 0 6px;
  height: 30px;
  cursor: pointer;
}

.toggle .icon {
  color: #fff;
  font-size: 0.85rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle .slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background-color: var(--accent);
  border-radius: 50%;
  transition: transform 0.3s ease;
  z-index: 0;
}

#theme-toggle:checked + .toggle .slider {
  transform: translateX(30px);
}

/* ================================
   Card (About Section)
================================= */
.card {
  background-color: var(--card-bg);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 700px;
  text-align: center;
}

.profile-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
}

h1, h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.tagline {
  font-style: italic;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ================================
   Footer
================================= */
.footer {
  width: 100%;
  padding: 1rem 2rem;
  background-color: var(--footer-bg);
  color: var(--header-footer-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
}

.footer-right {
  display: flex;
  gap: 1rem;
}

.footer-right a {
  color: var(--header-footer-text);
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

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

/* ================================
   Sidebar
================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background-color: var(--header-bg);
  color: var(--header-footer-text);
  padding: 1rem;
  transform: translateX(-100%) scale(0.98);
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
  opacity: 0;
}

.sidebar.open {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.sidebar-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-footer {
  font-size: 0.75rem;
  text-align: center;
  padding: 2rem 0 1rem;
  opacity: 0.6;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-menu a {
  color: var(--header-footer-text);
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: color 0.3s;
}

.sidebar-menu a:hover {
  color: var(--accent);
}

.close-btn {
  background: rgba(0, 0, 0, 0.45);
  color: white;
  border: none;
  font-size: 1.25rem;
  padding: 0.4rem 0.6rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .close-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

[data-theme="dark"] .close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ================================
   Sidebar Toggle Button
================================= */
.sidebar-toggle {
  -webkit-appearance: none;
  appearance: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 2100;
  border: none;
  font-size: 1.2rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, color 0.3s;
  background-color: #000 !important;
  color: #fff !important;
}

[data-theme="light"] .sidebar-toggle {
  background-color: #1c1c1c;
  color: var(--accent);
}

[data-theme="light"] .sidebar-toggle i {
  color: #fff;
}

[data-theme="dark"] .sidebar-toggle {
  background-color: #f5f5f5;
  color: var(--accent);
}

[data-theme="dark"] .sidebar-toggle i {
  color: #000;
}

.sidebar-toggle:hover {
  filter: brightness(1.1);
}

.sidebar-toggle.hidden {
  display: none;
}

[data-theme="light"] .sidebar-toggle {
  background-color: #000000 !important;
  color: #ff7e20 !important;
}

[data-theme="dark"] .sidebar-toggle {
  background-color: #ff7e20 !important;
  color: #fff !important;
}

.sidebar-toggle i {
  color: inherit;
}

[data-theme="light"] .sidebar-toggle {
  background-color: #ff7e20 !important;
  color: #fff !important;
}

[data-theme="light"] .sidebar-toggle:hover {
  background-color: #ff7e20 !important;
  color: #fff !important;
}

[data-theme="dark"] .sidebar-toggle {
  background-color: #fff;
  color: #000;
}

.sidebar-toggle:hover {
  background-color: #0b9427;
  color: #fff;
}

.sidebar-toggle:hover i {
  color: #fff;
}

.sidebar-toggle:hover,
.sidebar-toggle:active {
  background-color: var(--accent) !important;
  color: #fff !important;
}

.sidebar-toggle:hover i,
.sidebar-toggle:active i {
  color: #fff;
}

/* ================================
   Overlay
================================= */
.overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ================================
   Modal Styles
================================= */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0,0,0,0.5);
  z-index: 3000;
  align-items: flex-start;
  padding: 80px 0 60px;
  overflow-y: auto;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  background-color: var(--card-bg);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 2rem;
  text-align: left;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.modal-content .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.modal-cover {
  position: relative;
  width: calc(100% + 4rem);
  height: 220px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  margin: -2rem -2rem 1.5rem;
}

.modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: -70px auto 1.5rem;
  display: block;
  object-fit: cover;
  border: 3px solid var(--accent);
  background-color: var(--card-bg);
  position: relative;
  z-index: 10;
}

.modal-content h2 {
  text-align: center;
}

.modal-content ul.academic-history {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-content ul.academic-history li {
  margin-bottom: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

[data-theme="dark"] .modal-content ul.academic-history li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-content ul.academic-history li strong {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.modal-content ul.academic-history li span {
  font-size: 0.88rem;
  opacity: 0.75;
}

.modal-content ul.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.modal-content ul.skills li {
  background-color: var(--accent);
  color: white;
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

[data-theme="dark"] .modal-content ul.skills li {
  background-color: var(--accent);
}

.modal-content ul:not(.academic-history):not(.skills),
.modal-content ol,
.modal-content li {
  color: var(--text) !important;
  list-style-position: inside;
  padding-left: 1.25rem;
}

.modal-content a {
  color: var(--text) !important;
  text-decoration: underline;
}

.modal-content a:hover {
  color: var(--accent);
}

.modal-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-content ul {
  padding-left: 0;
  list-style: none;
}

.modal-content ul li {
  background-color: rgba(0,0,0,0.03);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.4;
}

[data-theme="dark"] .modal-content ul li {
  background-color: rgba(255,255,255,0.05);
}

.modal-content ul.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-inner p {
  margin-bottom: 1rem;
}

/* ================================
   Responsive
================================= */
@media (min-width: 601px) {
  .footer {
    flex-direction: row;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .card {
    margin: 1.5rem 1rem;
    padding: 1.5rem;
  }

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

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

  .sidebar {
    width: 75%;
  }

  .sidebar-toggle {
    top: 0.75rem;
    left: 0.75rem;
  }

  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}

/* ================================
   Language Toggle
================================= */
.lang-toggle {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.lang-toggle button {
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  background-color: #1c1c1c;
  color: #fff;
}

.lang-toggle button.active {
  background-color: var(--accent);
  color: #fff;
}

.lang-toggle button:hover:not(.active) {
  background-color: var(--accent);
  color: #000;
}

.lang-toggle button:hover {
  background-color: var(--accent);
  color: #fff;
}

[data-theme="light"] .lang-toggle button {
  background-color: #000;
  color: #fff;
}

[data-theme="light"] .lang-toggle button.active {
  background-color: var(--accent);
  color: #000 !important;
  box-shadow: 0 2px 8px rgba(233, 84, 32, 0.7);
}

[data-theme="light"] .lang-toggle button:hover:not(.active) {
  background-color: var(--accent);
  color: #000;
}

[data-theme="dark"] .lang-toggle button {
  background-color: #fff;
  color: #000;
}

[data-theme="dark"] .lang-toggle button.active {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 126, 41, 0.8);
}

[data-theme="dark"] .lang-toggle button:hover:not(.active) {
  background-color: var(--accent);
  color: #fff;
}

@media (max-width: 600px) {
  [data-theme="light"] .lang-toggle button {
    background-color: #1c1c1c;
    color: #fff;
  }
}

/* ================================
   Contact Form
================================= */
.contact-form {
  margin-top: 2rem;
}

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

.contact-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 6px;
  background: #fff;
  color: #000;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(0,0,0,0.15);
}

[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(25, 25, 25, 0.85);
  color: #fff;
  box-shadow: none;
}

[data-theme="dark"] .contact-form input:focus,
[data-theme="dark"] .contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ================================
   Scrollbar Customization (Optional)
================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 4px;
  border: 2px solid var(--bg);
}

/* ================================
   Utility Classes
================================= */
.hidden {
  display: none !important;
}

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

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

/* ================================
   Reach-Me
================================= */
.btn-submit {
  background-color: #1c1c1c;
  color: #fff;
  font-family: 'Ubuntu', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(28, 28, 28, 0.6);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.btn-submit:hover,
.btn-submit:focus {
  background-color: #ff6600;
  color: #fff;
  box-shadow: 0 6px 8px rgba(255, 102, 0, 0.6);
  outline: none;
}

.btn-submit:active {
  background-color: #cc5200;
  box-shadow: 0 2px 4px rgba(204, 82, 0, 0.8);
}

[data-theme="dark"] .btn-submit {
  background-color: #fff;
  color: #1a1a1a;
  box-shadow: 0 4px 6px rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .btn-submit:hover,
[data-theme="dark"] .btn-submit:focus {
  background-color: #ff6600;
  color: #fff;
  box-shadow: 0 6px 8px rgba(255, 102, 0, 0.6);
  outline: none;
}

[data-theme="dark"] .btn-submit:active {
  background-color: #cc5200;
  box-shadow: 0 2px 4px rgba(204, 82, 0, 0.8);
}

.back-btn {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.back-btn:hover {
  color: var(--accent) !important;
  cursor: pointer;
  transition: color 0.3s ease;
}
