/* Base Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #0f1419; /* Fallback solid color */
  color: #e0e6eb;
  min-height: 100vh;
  overflow-x: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Background canvas animation */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

body.tab-open {
  overflow-x: hidden;
}

body.tab-open .tabs-container {
  transform: translateX(-50%);
}

.container {
  max-width: 790px;
  margin: 40px auto;
  background: #1e2532;
  border-radius: 19px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  padding: 50px 30px 38px 30px;
  animation: fade-in 1.2s cubic-bezier(0.09, 1.03, 0.67, 0.98);
  border: 1px solid #2a3441;
}

h1, h2 {
  color: #7aa2f7;
  margin-bottom: 0.45em;
  font-weight: 700;
  letter-spacing: 0.03em;
}

h2 {
  margin-top: 2.1em;
  border-left: 4px solid #7aa2f7;
  padding-left: 12px;
  font-size: 1.22em;
  background: linear-gradient(90deg, rgba(122, 162, 247, 0.1) 90%, transparent 100%);
  transition: border-color 0.3s;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  animation: fade-in-up 0.7s forwards;
}

@keyframes fade-in {
  from { opacity: 0; transform:scale(0.99);}
  to { opacity: 1; transform:scale(1);}
}

@keyframes fade-in-up {
  to { opacity: 1; transform: translateY(0);}
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
  gap: 10px;
  animation-delay: 0.05s;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1em;
  font-size: 1.01em;
  color: #9ca3af;
}

.contact a {
  color: #7aa2f7;
  text-decoration: none;
  transition: color 0.2s;
}

.contact a:hover {
  color: #a5b4fc;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e0e6eb;
  text-decoration: none;
  font-weight: 600;
  background: #2a3441;
  padding: 3px 10px 3px 7px;
  border-radius: 16px;
  transition: background 0.11s, color 0.11s;
}

.github-link:hover {
  color: #fff;
  background: #7aa2f7;
}

.github-link svg {
  vertical-align: middle;
  width: 18px; height: 18px;
  fill: #e0e6eb;
}

.desc {
  text-align: center;
  max-width: 630px;
  margin: 8px auto 24px auto;
  color: #9ca3af; 
  font-size:1.11em;
}

section {
  margin-bottom: 1.6em;
  animation-delay: 0.12s;
  padding-bottom: 0.2em;
}

ul {
  margin: 7px 0 0 0.7em;
  padding-left: 16px;
  font-size: 1em;
}

li {
  margin-bottom: 3px;
}

.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
}

.card {
  flex: 1 1 270px;
  background: #252d3a;
  border-radius: 12px;
  padding: 18px 17px 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.19s, box-shadow 0.23s, background 0.23s;
  cursor: pointer;
  min-width: 230px;
  border-left: 6px solid #7aa2f760;
  animation: card-anim 0.85s cubic-bezier(.4,1.86,.96,.81);
}

.card:hover{
  transform: translateY(-5px) scale(1.03) rotate(-1.2deg);
  box-shadow: 0 6px 22px rgba(122, 162, 247, 0.2);
  border-left-color: #7aa2f7;
  background: #2a3441;
}

@keyframes card-anim {
  from { opacity: 0; filter: blur(8px); transform: translateY(24px) scale(.98);}
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1);}
}

.card h3 {
  margin: 0 0 6px 0;
  color: #7aa2f7;
  font-size: 1.10em;
  font-weight: 700;
}

.card .github-link {
  margin-top: 10px;
  font-size: 0.98em;
  padding: 2px 8px 2px 6px;
  background: #2a3441;
}

.tags {
  margin-top: 7px;
  color: #9ca3af; 
  font-size: 0.97em;
}

.timeline {
  padding-left: 0;
  list-style: none;
  border-left: 3px solid #2a3441;
  margin-left:9px;
}

.timeline li {
  position: relative;
  margin-bottom: 16px;
  padding-left: 15px;
  cursor: pointer;
  transition: padding-left 0.2s;
}

.timeline li:hover {
  padding-left: 18px;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 2px;
  width: 11px;
  height: 11px;
  background-color: #7aa2f7;
  border-radius: 60%;
  box-shadow: 0 1px 4px rgba(122, 162, 247, 0.4);
  border: 2.5px solid #1e2532;
  transition: transform 0.2s;
}

.timeline li:hover::before {
  transform: scale(1.2);
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-top: 10px;
}

.skills-list span {
  background: #252d3a;
  padding: 6px 13px 6px 11px;
  border-radius: 12px;
  color: #9ca3af;
  font-size: 1em;
  margin-bottom: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  border: 1px solid #2a3441;
}

.footer {
  text-align: center;
  color: #6b7280;
  font-size: 0.98em;
  margin-top: 45px;
}

.footer a {
  color: #7aa2f7;
  text-decoration: none;
}

.footer a:hover {
  color: #a5b4fc;
}

/* Tab System Styles */
.tabs-container {
  display: flex;
  width: 200%;
  min-height: 100vh;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  will-change: transform;
}

.tab-panel {
  width: 50%;
  flex-shrink: 0;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  min-height: 100vh;
}

#mainTab {
  order: 1;
}

#detailTab {
  order: 2;
  background: linear-gradient(120deg, #0f1419 0%, #1a1f2e 100%);
  display: block;
  visibility: visible;
}

.detail-tab {
  background: #1e2532;
  border-radius: 19px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  padding: 50px 30px 38px 30px;
  border: 1px solid #2a3441;
  max-width: 790px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.detail-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #2a3441;
}

.detail-tab-header h2 {
  margin: 0;
  color: #7aa2f7;
  font-size: 1.8em;
}

.close-tab-btn {
  background: #2a3441;
  border: none;
  color: #9ca3af;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-tab-btn:hover {
  background: #7aa2f7;
  color: #fff;
}

.detail-content {
  color: #e0e6eb;
  line-height: 1.7;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.detail-content p {
  margin: 15px 0;
  color: #9ca3af;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.detail-content strong {
  color: #7aa2f7;
}

.detail-content ul {
  margin: 15px 0;
  padding-left: 20px;
}

.detail-content li {
  margin: 8px 0;
  color: #9ca3af;
}

.detail-content a {
  color: #7aa2f7;
  text-decoration: none;
  transition: color 0.2s;
}

.detail-content a:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Floating Buttons */
.floating-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  transition: transform 0.3s;
}

.lang-switcher {
  display: flex;
  gap: 6px;
  background: rgba(30, 37, 50, 0.9);
  backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid #2a3441;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lang-btn {
  background: #252d3a;
  border: 1px solid #2a3441;
  color: #9ca3af;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: #2a3441;
  color: #e0e6eb;
}

.lang-btn.active {
  background: #7aa2f7;
  color: #fff;
  border-color: #7aa2f7;
}

.help-toggle {
  background: rgba(30, 37, 50, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid #2a3441;
  color: #9ca3af;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.help-toggle:hover {
  background: rgba(42, 52, 65, 0.95);
  color: #e0e6eb;
}

/* Help Popup Modal */
.help-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.help-popup.active {
  opacity: 1;
  visibility: visible;
}

.help-modal {
  background: #1e2532;
  border-radius: 16px;
  padding: 30px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid #2a3441;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.help-popup.active .help-modal {
  transform: scale(1);
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #2a3441;
}

.help-modal-header h3 {
  color: #7aa2f7;
  margin: 0;
}

.help-modal-close {
  background: #2a3441;
  border: none;
  color: #9ca3af;
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.help-modal-close:hover {
  background: #7aa2f7;
  color: #fff;
}

.help-modal-content {
  color: #9ca3af;
  line-height: 1.7;
}

.help-modal-content p {
  margin: 10px 0;
}

.help-modal-content ul {
  margin: 15px 0;
  padding-left: 20px;
}

.help-modal-content li {
  margin: 8px 0;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE SUPPORT
   ============================================ */

/* Tablet and small desktop adjustments */
@media (max-width: 900px) {
  .container {
    max-width: 90%;
    padding: 40px 25px;
  }
  
  .cards {
    gap: 15px;
  }
  
  .card {
    flex: 1 1 100%;
  }
}

/* Mobile landscape and smaller tablets */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }
  
  .container {
    max-width: 95%;
    padding: 30px 20px;
    margin: 20px auto;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  h2 {
    font-size: 1.3em;
    margin-top: 1.5em;
  }
  
  .header {
    margin-bottom: 20px;
  }
  
  .contact {
    flex-direction: column;
    gap: 0.7em;
    font-size: 0.95em;
  }
  
  .contact a,
  .contact span {
    display: block;
  }
  
  .github-link {
    padding: 6px 12px;
    font-size: 0.9em;
  }
  
  .desc {
    font-size: 1em;
    padding: 0 10px;
  }
  
  .cards {
    flex-direction: column;
  }
  
  .card {
    min-width: 100%;
  }
  
  .timeline li {
    padding-left: 20px;
    font-size: 0.95em;
  }
  
  .skills-list {
    flex-direction: column;
    gap: 12px;
  }
  
  .skills-list span {
    width: 100%;
    text-align: center;
  }
  
  .detail-tab {
    padding: 30px 20px;
  }
  
  .detail-tab-header h2 {
    font-size: 1.4em;
  }
  
  .close-tab-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}

/* Mobile portrait */
@media (max-width: 670px) {
  body {
    font-size: 15px;
  }
  
  .container {
    padding: 20px 15px;
    margin: 15px auto;
    border-radius: 12px;
  }
  
  h1 {
    font-size: 1.6em;
    text-align: center;
  }
  
  h2 {
    font-size: 1.2em;
    padding-left: 10px;
  }
  
  .header {
    text-align: center;
  }
  
  .contact {
    font-size: 0.9em;
    gap: 0.5em;
    text-align: center;
  }
  
  .github-link {
    display: inline-flex;
    padding: 5px 10px;
    font-size: 0.85em;
  }
  
  .github-link svg {
    width: 14px;
    height: 14px;
  }
  
  .desc {
    font-size: 0.95em;
    text-align: center;
  }
  
  section {
    margin-bottom: 1.2em;
  }
  
  ul {
    padding-left: 12px;
    margin-left: 0.5em;
  }
  
  .cards {
    gap: 12px;
  }
  
  .card {
    padding: 15px;
    border-radius: 10px;
  }
  
  .card h3 {
    font-size: 1.05em;
  }
  
  .card:hover {
    transform: translateY(-3px) scale(1.01);
  }
  
  .tags {
    font-size: 0.9em;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  .tags span {
    font-size: 0.85em;
  }
  
  .timeline {
    margin-left: 5px;
  }
  
  .timeline li {
    padding-left: 15px;
    font-size: 0.9em;
    margin-bottom: 12px;
  }
  
  .timeline li::before {
    left: -8px;
    width: 9px;
    height: 9px;
  }
  
  .skills-list span {
    font-size: 0.9em;
    padding: 8px 12px;
  }
  
  .footer {
    font-size: 0.85em;
    margin-top: 30px;
  }
  
  /* Floating controls - mobile optimized */
  .floating-controls {
    top: 10px;
    right: 10px;
    gap: 8px;
  }
  
  .lang-switcher {
    gap: 4px;
    padding: 4px;
  }
  
  .lang-btn {
    padding: 6px 12px;
    font-size: 0.8em;
    min-width: 40px;
  }
  
  .help-toggle {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  
  /* Help modal - mobile optimized */
  .help-modal {
    margin: 15px;
    padding: 20px 15px;
    max-width: calc(100% - 30px);
  }
  
  .help-modal-header h3 {
    font-size: 1.1em;
  }
  
  .help-modal-close {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }
  
  .help-modal-content {
    font-size: 0.9em;
  }
  
  .help-modal-content ul {
    padding-left: 15px;
  }
  
  /* Tab system - mobile optimized */
  .tabs-container {
    width: 200%;
  }
  
  .tab-panel {
    width: 50%;
    padding: 20px 10px;
  }
  
  .detail-tab {
    padding: 20px 15px;
    border-radius: 12px;
    min-height: 100vh;
  }
  
  .detail-tab-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    flex-wrap: wrap;
  }
  
  .detail-tab-header h2 {
    font-size: 1.5em;
    margin: 0;
    flex: 1 1 100%;
    margin-bottom: 10px;
  }
  
  .close-tab-btn {
    width: 44px;
    height: 44px;
    font-size: 26px;
    position: absolute;
    top: 15px;
    right: 15px;
  }
  
  .detail-content {
    font-size: 1.05em;
    line-height: 1.7;
  }
  
  .detail-content h3 {
    font-size: 1.3em;
    margin-top: 25px;
  }
  
  .detail-content p {
    margin: 15px 0;
    font-size: 1em;
  }
  
  .detail-content strong {
    font-size: 1em;
  }
  
  .detail-content ul {
    padding-left: 20px;
  }
  
  .detail-content li {
    margin: 10px 0;
    line-height: 1.6;
  }
}

/* Small mobile devices */
@media (max-width: 400px) {
  body {
    font-size: 13px;
  }
  
  .container {
    padding: 15px 10px;
    margin: 10px auto;
  }
  
  h1 {
    font-size: 1.4em;
  }
  
  h2 {
    font-size: 1.1em;
  }
  
  .contact {
    font-size: 0.85em;
  }
  
  .github-link {
    padding: 4px 8px;
    font-size: 0.8em;
  }
  
  .card {
    padding: 12px;
  }
  
  .card h3 {
    font-size: 1em;
  }
  
  .floating-controls {
    top: 8px;
    right: 8px;
    gap: 6px;
  }
  
  .lang-btn,
  .help-toggle {
    padding: 5px 10px;
    font-size: 0.75em;
  }
  
  .help-modal {
    margin: 10px;
    padding: 15px 12px;
  }
  
  .detail-tab {
    padding: 15px 12px;
  }
  
  .detail-tab-header h2 {
    font-size: 1.2em;
  }
  
  .close-tab-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
    top: 12px;
    right: 12px;
  }
}

/* Landscape orientation improvements */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    margin: 10px auto;
  }
  
  .header {
    margin-bottom: 15px;
  }
  
  section {
    margin-bottom: 1em;
  }
  
  .floating-controls {
    top: 5px;
    right: 5px;
  }
  
  .help-modal {
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  .card,
  .timeline li,
  .lang-btn,
  .help-toggle,
  .close-tab-btn {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(122, 162, 247, 0.2);
  }
  
  /* Larger touch targets */
  .card {
    padding: 18px;
  }
  
  .lang-btn,
  .help-toggle {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .close-tab-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .timeline li {
    padding: 10px 10px 10px 20px;
  }
  
  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }
  
  /* Add active state instead */
  .card:active {
    transform: scale(0.98);
    opacity: 0.9;
  }
  
  .timeline li:hover {
    padding-left: 20px;
  }
  
  .timeline li:active {
    background: rgba(122, 162, 247, 0.1);
    border-radius: 8px;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }
  
  .floating-controls,
  .help-popup,
  #detailTab {
    display: none !important;
  }
  
  .container {
    box-shadow: none;
    max-width: 100%;
    margin: 0;
  }
  
  .card,
  .timeline li {
    cursor: default;
    break-inside: avoid;
  }
  
  a {
    text-decoration: underline;
  }
  
  .github-link {
    background: transparent;
    color: #000;
  }
}


/* File Tree Styles */
.file-tree {
  margin: 15px 0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.file-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.file-icon {
  margin-right: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

.file-name {
  color: #7aa2f7;
  font-weight: 600;
  flex-shrink: 0;
}

.file-desc {
  color: #9ca3af;
  font-size: 13px;
  margin-left: 8px;
  font-style: italic;
}

/* Responsive file tree */
@media (max-width: 670px) {
  .file-tree {
    font-size: 13px;
  }
  
  .file-item {
    flex-wrap: wrap;
  }
  
  .file-desc {
    width: 100%;
    margin-left: 24px;
    margin-top: 2px;
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .file-tree {
    font-size: 12px;
  }
  
  .file-icon {
    font-size: 14px;
    margin-right: 6px;
  }
}
