/* TI-84 Calculator - Exact Copy of Current Working Tool */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and base styles for plugin */
.ti84-calculator-container {
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-feature-settings: normal;
  font-variation-settings: normal;
  margin: 0;
  padding: 0;
}

.ti84-calculator-container *,
.ti84-calculator-container ::before,
.ti84-calculator-container ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

.ti84-calculator-container h1,
.ti84-calculator-container h2,
.ti84-calculator-container h3,
.ti84-calculator-container h4,
.ti84-calculator-container h5,
.ti84-calculator-container h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

.ti84-calculator-container ol,
.ti84-calculator-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ti84-calculator-container img,
.ti84-calculator-container svg,
.ti84-calculator-container video,
.ti84-calculator-container canvas,
.ti84-calculator-container audio,
.ti84-calculator-container iframe,
.ti84-calculator-container embed,
.ti84-calculator-container object {
  display: block;
  vertical-align: middle;
}

.ti84-calculator-container input,
.ti84-calculator-container optgroup,
.ti84-calculator-container select,
.ti84-calculator-container textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

.ti84-calculator-container button,
.ti84-calculator-container input,
.ti84-calculator-container optgroup,
.ti84-calculator-container select,
.ti84-calculator-container textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

.ti84-calculator-container button,
.ti84-calculator-container select {
  text-transform: none;
}

.ti84-calculator-container button,
.ti84-calculator-container [type='button'],
.ti84-calculator-container [type='reset'],
.ti84-calculator-container [type='submit'] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

/* Custom animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.float-animation {
  animation: float 6s ease-in-out infinite;
}

.calculator-button {
  transition: all 0.2s ease;
}

.calculator-button:hover {
  transform: translateY(-1px);
}

.calculator-button:active {
  transform: translateY(1px);
}

.glass-effect {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.neon-glow {
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  .ti84-calculator-container input[type="text"], 
  .ti84-calculator-container input[type="number"], 
  .ti84-calculator-container input[type="email"], 
  .ti84-calculator-container input[type="password"] {
    font-size: 16px;
  }
  
  .ti84-calculator-container button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Main calculator container - exact copy of working design */
.ti84-main-container {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.5rem;
  user-select: none;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.ti84-main-container.light {
  background: linear-gradient(135deg, #ecfdf5 0%, #e0f2fe 50%, #e0e7ff 100%);
}

.ti84-main-container.dark {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

/* Ambient gradient blobs - exact copy */
.ambient-blob-1 {
  pointer-events: none;
  position: absolute;
  top: -6rem;
  left: -6rem;
  height: 18rem;
  width: 18rem;
  border-radius: 50%;
  filter: blur(3rem);
  animation: pulse 2s infinite;
}

.ambient-blob-2 {
  pointer-events: none;
  position: absolute;
  bottom: -6rem;
  right: -6rem;
  height: 20rem;
  width: 20rem;
  border-radius: 50%;
  filter: blur(3rem);
  animation: pulse 2s infinite;
}

.light .ambient-blob-1 {
  background-color: rgba(34, 197, 94, 0.3);
}

.light .ambient-blob-2 {
  background-color: rgba(6, 182, 212, 0.3);
}

.dark .ambient-blob-1 {
  background-color: rgba(236, 72, 153, 0.3);
}

.dark .ambient-blob-2 {
  background-color: rgba(168, 85, 247, 0.3);
}

/* Main bezel - exact copy */
.ti84-bezel {
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-width: 1px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.light .ti84-bezel {
  border-color: rgba(34, 197, 94, 0.3);
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px);
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --tw-ring-color: rgba(34, 197, 94, 0.2);
}

.dark .ti84-bezel {
  border-color: rgba(236, 72, 153, 0.4);
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(40px);
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --tw-ring-color: rgba(236, 72, 153, 0.3);
}

@media (min-width: 640px) {
  .ti84-main-container {
    padding: 1.5rem;
  }
  
  .ti84-bezel {
    border-radius: 1.5rem;
  }
}

/* Tabs styling - exact copy */
.ti84-tabs {
  display: flex;
  gap: 0.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.75rem;
  overflow-x: auto;
}

@media (min-width: 640px) {
  .ti84-tabs {
    gap: 0.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1.25rem;
  }
}

.ti84-tab-button {
  border-radius: 0.75rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

@media (min-width: 640px) {
  .ti84-tab-button {
    border-radius: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    font-size: 0.875rem;
  }
}

.ti84-tab-button:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Active tab styling */
.ti84-tab-button.active.light {
  background: linear-gradient(135deg, #059669, #06d6a0);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ti84-tab-button.active.dark {
  background: linear-gradient(135deg, #ec4899, #a855f7, #06d6a0);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Inactive tab styling */
.ti84-tab-button.inactive {
  background-color: rgba(255, 255, 255, 0.6);
  color: #374151;
  border-width: 1px;
  border-color: rgba(229, 231, 235, 0.7);
}

.dark .ti84-tab-button.inactive {
  background-color: rgba(38, 38, 38, 0.6);
  color: #f3f4f6;
  border-color: rgba(64, 64, 64, 0.7);
}

/* Mode controls */
.ti84-mode-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-right: 0.25rem;
}

@media (min-width: 640px) {
  .ti84-mode-controls {
    gap: 0.5rem;
    padding-right: 0.75rem;
  }
}

.ti84-mode-label {
  font-size: 0.75rem;
  color: #6b7280;
  display: none;
}

@media (min-width: 640px) {
  .ti84-mode-label {
    display: inline;
  }
}

.ti84-mode-button {
  border-radius: 0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, #059669, #06d6a0);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ti84-mode-button:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.ti84-mode-button:active {
  transform: translateY(1px);
}

@media (min-width: 640px) {
  .ti84-mode-button {
    border-radius: 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-size: 0.875rem;
  }
}

.ti84-theme-button {
  border-radius: 0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ec4899, #a855f7, #06d6a0);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ti84-theme-button:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@media (min-width: 640px) {
  .ti84-theme-button {
    border-radius: 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-size: 0.875rem;
  }
}

/* Calculator screen - exact copy */
.ti84-screen-container {
  margin: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  border-width: 1px;
  background: linear-gradient(to bottom, #000000, #171717);
  border-color: #404040;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --tw-ring-color: rgba(34, 197, 94, 0.1);
}

.dark .ti84-screen-container {
  background: linear-gradient(to bottom, #000000, #171717);
  border-color: rgba(236, 72, 153, 0.4);
  --tw-ring-color: rgba(236, 72, 153, 0.3);
}

@media (min-width: 640px) {
  .ti84-screen-container {
    margin: 1rem;
    padding: 0.75rem;
    border-radius: 1rem;
  }
}

.ti84-screen {
  width: 100%;
  height: 4rem;
  border-radius: 0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-family: monospace;
  text-align: right;
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  overflow: hidden;
  color: #a7f3d0;
  background-image: radial-gradient(circle at 30% 20%, rgba(16, 185, 129, 0.15), transparent 60%);
}

.dark .ti84-screen {
  color: #fbb6ce;
  background-image: radial-gradient(circle at 30% 20%, rgba(236, 72, 153, 0.15), transparent 60%);
}

@media (min-width: 640px) {
  .ti84-screen {
    height: 6rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1.5rem;
  }
}

.ti84-screen-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(34, 197, 94, 0.9);
}

.dark .ti84-screen-status {
  color: rgba(236, 72, 153, 0.9);
}

@media (min-width: 640px) {
  .ti84-screen-status {
    font-size: 0.875rem;
  }
}

/* Button grid styling - exact copy */
.ti84-button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.5rem;
  padding-top: 0.25rem;
}

@media (min-width: 640px) {
  .ti84-button-grid {
    gap: 0.5rem;
    padding: 1rem;
    padding-top: 0.5rem;
  }
}

.ti84-button-grid-mem {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-bottom: 0.25rem;
}

@media (min-width: 640px) {
  .ti84-button-grid-mem {
    gap: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 0.5rem;
  }
}

.ti84-calc-button {
  border-radius: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  border-width: 1px;
  touch-action: manipulation;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.7);
  border-color: rgba(229, 231, 235, 0.7);
  color: #374151;
}

.ti84-calc-button:hover {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.dark .ti84-calc-button {
  background-color: rgba(64, 64, 64, 0.7);
  border-color: rgba(115, 115, 115, 0.7);
  color: #d1d5db;
}

.dark .ti84-calc-button:hover {
  background-color: rgba(82, 82, 82, 0.8);
}

.ti84-calc-button:active {
  transform: translateY(1px);
}

@media (min-width: 640px) {
  .ti84-calc-button {
    border-radius: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 0.875rem;
  }
}

/* Special button variants */
.ti84-calc-button.accent.light {
  background: linear-gradient(135deg, #059669, #06d6a0);
  color: white;
  border-color: #047857;
}

.ti84-calc-button.accent.light:hover {
  background: linear-gradient(135deg, #047857, #059669);
}

.ti84-calc-button.accent.dark {
  background: linear-gradient(135deg, #ec4899, #a855f7, #06d6a0);
  color: white;
  border-color: #ec4899;
}

.ti84-calc-button.accent.dark:hover {
  background: linear-gradient(135deg, #db2777, #9333ea, #059669);
}

/* Footer styling */
.ti84-footer {
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.75rem;
}

.dark .ti84-footer {
  color: #9ca3af;
}

/* Utility classes for exact match */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Animation utilities */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive visibility */
@media (max-width: 639px) {
  .sm\\:hidden {
    display: none;
  }
}

@media (min-width: 640px) {
  .sm\\:inline {
    display: inline;
  }
}