/* Add Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Code&display=swap');

/* Modern Taoverter Styles */
:root {
  --bg: #ffffff;
  --text: #333333;
  --card: #ffffff;
  --border: #e0e0e0;
  --primary: #3f51b5;
  --primary-light: #757de8;
  --primary-dark: #002984;
  --accent: #ff4081;
  --button-bg: #3f51b5;
  --button-text: #ffffff;
  --header-bg: #ffffff;
  --card-bg: #ffffff;
  --text-color: #333333;
  --border-color: #e0e0e0;
  --input-bg: #f5f5f5;
  --hover-bg: #eeeeee;
  --secondary-bg: #f5f5f5;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.dark {
  --bg: #121212;
  --text: #f5f5f5;
  --card: #1e1e1e;
  --border: #333333;
  --primary: #7986cb;
  --primary-light: #aab6fe;
  --primary-dark: #49599a;
  --accent: #ff80ab;
  --button-bg: #7986cb;
  --button-text: #ffffff;
  --header-bg: #1a1a1a;
  --card-bg: #2d2d2d;
  --text-color: #ffffff;
  --border-color: #404040;
  --input-bg: #3d3d3d;
  --hover-bg: #404040;
  --secondary-bg: #2d2d2d;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  transition: var(--transition);
  line-height: 1.6;
}

/* Modern Header styling */
.site-header {
  padding: 1.5rem 2rem;
  background: var(--header-bg);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 10;
  margin-bottom: 2rem;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header controls container */
.header-controls {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language selector styling */
.lang-selector {
  position: relative;
  display: inline-block;
}

.lang-selector label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

#langSelect {
  padding: 0.5rem 2.5rem 0.5rem 2.5rem;
  font-size: 0.9rem;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 1em;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  transition: var(--transition);
}

/* Theme toggle button styling */
.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.2rem;
}

/* Hover effects */
#langSelect:hover,
.theme-toggle:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Title styling */
.site-header h1 {
  text-align: center;
  margin: 1rem 0 0.5rem;
  font-size: 2.2rem;
  color: var(--text-color);
  font-weight: 700;
}

.site-description {
  margin: 0 0 1rem;
  text-align: center;
  color: var(--text);
  opacity: 0.8;
  font-size: 1.1rem;
  max-width: 700px;
}

/* Modern navigation styling - Side Panel */
.tool-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--secondary-bg);
  border-radius: 0 12px 12px 0;
  width: 200px;
  box-shadow: var(--shadow);
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  transition: width 0.3s ease;
}

.tool-nav:hover {
  width: 240px;
}

.tab-button {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  display: flex;
  align-items: center;
}

.tab-button::before {
  content: '';
  display: inline-block;
  min-width: 20px;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.tab-button[data-tab="anniversary"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

.tab-button[data-tab="diff"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
}

.tab-button[data-tab="math"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.tab-button[data-tab="convert"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='17 1 21 5 17 9'%3E%3C/polyline%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'%3E%3C/path%3E%3Cpolyline points='7 23 3 19 7 15'%3E%3C/polyline%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'%3E%3C/path%3E%3C/svg%3E");
}

.tab-button:hover {
  background: var(--hover-bg);
  transform: translateX(5px);
}

.tab-button.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.tab-button.active::before {
  opacity: 1;
}

/* Tooltip for tab buttons - removed */

/* Tool sections styling */
.tools-container {
  max-width: 800px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem 0 calc(200px + 2rem); /* Add padding to account for side nav */
  transition: padding 0.3s ease; /* Smooth transition when resizing */
}

.tool-section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tool-section.active {
  display: block;
}

/* Tool box styling */
.tool-box {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.tool-box:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Inputs and buttons */
input, select {
  font-size: 1rem;
  padding: 0.75rem 1rem;
  margin: 0.4rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--input-bg);
  color: var(--text-color);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transition: var(--transition);
}

button {
  font-size: 1rem;
  padding: 0.75rem 1.25rem;
  margin: 0.4rem 0;
  border-radius: 8px;
  border: none;
  background-color: var(--button-bg);
  color: var(--button-text);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.2);
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.3);
}

button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Result box */
.result-box {
  background-color: var(--secondary-bg);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.result-box:hover {
  box-shadow: var(--shadow);
}

.result-box h3 {
  margin-top: 0;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.1rem;
}

.custom-milestone {
  background-color: var(--secondary-bg);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--accent);
  transition: var(--transition);
}

.custom-milestone:hover {
  box-shadow: var(--shadow);
}

.custom-milestone h3 {
  margin-top: 0;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.1rem;
}

.milestone-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Time adjust controls styling */
.time-adjust-controls {
  margin: 1rem 0;
}

.time-adjust-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.time-adjust-inputs select#adjustType {
  width: 80px;
  flex: 0 0 80px;
}

.time-adjust-inputs input#adjustValue {
  width: 80px;
  flex: 0 0 80px;
}

.time-adjust-inputs select#adjustUnit {
  flex: 1;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background-color: rgba(0, 0, 0, 0.04);
  padding: 1rem;
  border-radius: 8px;
  color: var(--text-color);
  font-family: 'Fira Code', monospace;
  margin: 0.5rem 0;
  font-size: 0.95rem;
  transition: var(--transition);
}

body.dark pre {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 4rem;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.7;
  border-top: 1px solid var(--border-color);
}

/* Responsive design */
@media (max-width: 768px) {
  .site-header {
    padding: 1rem;
  }
  
  .header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .header-controls {
    position: static;
    margin-bottom: 1rem;
  }

  .site-header h1 {
    padding: 0;
    font-size: 1.5rem;
    text-align: center;
    margin: 1rem 0 0.5rem;
  }
  
  .site-description {
    font-size: 1rem;
  }

  /* Convert side nav to bottom nav for mobile */
  .tool-nav {
    flex-direction: row;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: auto;
    transform: none;
    margin: 0;
    border-radius: 0;
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    background-color: var(--bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }
  
  .tool-nav:hover {
    width: 100%;
  }
  
  .tab-button {
    border-radius: 6px;
    padding: 0.6rem 0.25rem;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  .tab-button:hover {
    transform: translateY(-3px);
  }
  
  .tab-button::before {
    margin-right: 0;
    margin-bottom: 4px;
    width: 24px;
    height: 24px;
  }
  
  .tab-button.active::before {
    opacity: 1;
  }
  
  /* Reset tools container padding for mobile */
  .tools-container {
    padding: 0 1.5rem;
    margin-bottom: 5rem;
  }
  
  .tool-box {
    padding: 1.5rem;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .milestone-inputs {
    grid-template-columns: 1fr;
  }
}

/* Fade animation for text changes */
.fade {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.fade.show {
  opacity: 1;
}

/* SEO-friendly content styling */
.site-description {
  margin-top: 0;
  text-align: center;
  color: #666;
  font-size: 1.1rem;
}

.seo-content {
  margin-top: 2rem;
  padding: 1rem;
  border-top: 1px solid #eee;
  color: #333;
}

/* Make SEO content visible to search engines but hidden from users */
@media screen {
  .seo-content {
    display: none;
  }
}