/* Critical CSS - Only essential styles for above-the-fold content */

/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'SegoeUI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: #f8f9fb;
  color: #333;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.app-header {
  background: #000000;
  width: 100%;
  padding: 0.5rem 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  left: 0;
}

.header-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-link {
  display: block;
  text-decoration: none;
}

.calculator-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding: 0;
  list-style: none;
  margin-left: auto;
}

main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  min-height: 600px;
}

.calculator-container {
  width: 100%;
  max-width: 405px;
  background: white;
  border-radius: 1.5rem;
  padding: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: all 0.5s ease;
  margin: 0 auto;
  z-index: 10;
}

.calculator-display {
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 0;
  text-align: right;
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  color: #1e293b;
}

.current-value {
  font-size: 2rem;
  font-weight: bold;
  color: #0f172a;
  word-break: break-all;
}

.calculation {
  font-size: 1.125rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  min-height: 1.5rem;
  word-break: break-all;
}

/* Loading state */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 107, 107, 0.2);
  border-top-color: #ff6b6b;
  border-radius: 50%;
  animation: spinner 1s ease-in-out infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
  .calculator-container {
    max-width: 95%;
    margin: 0 auto;
  }
  
  .calculator-display {
    padding: 15px;
  }
  
  .app-header {
    padding: 0.8rem 1.5rem;
  }
  
  .header-menu {
    flex-wrap: wrap;
  }
  
  .nav-links {
    justify-content: flex-end;
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .header-menu {
    flex-direction: column;
    align-items: center;
  }
  
  .calculator-logo {
    margin-bottom: 0.5rem;
  }
  
  .nav-links {
    justify-content: center;
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .calculator-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 8px;
    border-radius: 0.5rem;
  }
  
  .calculator-display {
    padding: 8px;
    min-height: 5rem;
  }
  
  .current-value {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  
  .calculation {
    font-size: 0.9rem;
  }
  
  .app-header {
    padding: 0.5rem 1rem;
  }
  
  .nav-links button {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
}

/* Direct fix for calculator position on mobile */
@media screen and (max-width: 767px) {
  html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  
  #root {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .app {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
  }
  
  .app-header {
    width: 100%;
    max-width: 100vw;
    padding: 0.5rem 1rem !important;
    box-sizing: border-box;
  }
  
  main {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    padding: 0 10px !important;
    position: relative !important;
  }
  
  .calculator-container {
    position: static !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 90% !important;
    max-width: 90% !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
    padding: 6px !important;
    border-radius: 8px !important;
  }
  
  .button-grid {
    grid-gap: 6px !important;
    padding: 6px !important;
  }
} 