/* TI-84 Plus CE Calculator - Ultra Realistic Design */
@import url('https://fonts.googleapis.com/css2?family=Arial:wght@400;700;900&display=swap');

/* Reset and base styles */
.ti84-calculator-container {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  perspective: 1000px;
}

.ti84-calculator-container *,
.ti84-calculator-container ::before,
.ti84-calculator-container ::after {
  box-sizing: border-box;
}

/* Main Calculator Body - Ultra Realistic TI-84 Shell */
.ti84-main-container {
  width: 260px;
  height: 520px;
  background: linear-gradient(145deg, #2c2c2c 0%, #1a1a1a 50%, #2c2c2c 100%);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 5px 15px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  border: 3px solid #1a1a1a;
  position: relative;
  transform: rotateX(5deg) rotateY(-2deg);
  transition: transform 0.3s ease;
}

.ti84-main-container:hover {
  transform: rotateX(3deg) rotateY(-1deg) scale(1.02);
}

/* TI-84 Branding - Authentic */
.ti84-branding {
  text-align: center;
  margin-bottom: 12px;
  color: #e0e0e0;
  font-family: Arial, sans-serif;
}

.ti84-model {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 3px;
  letter-spacing: 2px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.ti84-brand {
  font-size: 10px;
  color: #b0b0b0;
  font-weight: bold;
  letter-spacing: 1px;
}

/* LCD Screen Container - Authentic */
.ti84-screen-container {
  background: linear-gradient(145deg, #0d1520, #1a2332);
  border: 4px solid #0a0f1a;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: 
    inset 0 3px 8px rgba(0, 0, 0, 0.7),
    inset 0 -1px 2px rgba(255, 255, 255, 0.1),
    0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.ti84-screen-container::before {
  content: 'TI-84 Plus CE';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: #888;
  font-weight: bold;
  letter-spacing: 1px;
}

/* LCD Screen - Authentic Green Display */
.ti84-screen {
  background: linear-gradient(135deg, #001a00, #003300);
  color: #00ff00;
  font-family: 'Courier New', 'Liberation Mono', monospace;
  font-size: 12px;
  font-weight: bold;
  height: 90px;
  padding: 8px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid #001100;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(0, 255, 0, 0.1);
  text-shadow: 0 0 2px rgba(0, 255, 0, 0.5);
  position: relative;
}

.ti84-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 98%, rgba(0, 255, 0, 0.03) 100%);
  pointer-events: none;
}

.ti84-screen.dark {
  background: linear-gradient(135deg, #001a2e, #003366);
  color: #00ccff;
  text-shadow: 0 0 2px rgba(0, 204, 255, 0.5);
}

.ti84-screen.dark::after {
  background: linear-gradient(90deg, transparent 98%, rgba(0, 204, 255, 0.03) 100%);
}

/* Status Line */
.ti84-screen-status {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #70ff70;
  margin-bottom: 4px;
  border-bottom: 1px solid #4a4a4a;
  padding-bottom: 2px;
}

.dark .ti84-screen-status {
  color: #88ffaa;
}

/* Calculator Tabs - Made to look like actual TI-84 mode buttons */
.ti84-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 8px;
  justify-content: center;
}

.ti84-tab-button {
  background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
  border: 1px solid #666;
  border-radius: 3px;
  color: #ddd;
  font-size: 7px;
  font-weight: bold;
  padding: 3px 6px;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
}

.ti84-tab-button:hover {
  background: linear-gradient(145deg, #555, #333);
}

.ti84-tab-button.active {
  background: linear-gradient(145deg, #666, #444);
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Mode Controls */
.ti84-mode-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ti84-mode-button, .ti84-theme-button {
  background: linear-gradient(145deg, #444, #222);
  border: 1px solid #666;
  border-radius: 2px;
  color: #ccc;
  font-size: 7px;
  padding: 2px 4px;
  cursor: pointer;
}

/* Button Grid - TI-84 Style Layout */
.ti84-button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-bottom: 4px;
}

.ti84-button-grid-mem {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

/* TI-84 Style Buttons - Ultra Realistic */
.ti84-calc-button {
  border: 2px solid #333;
  border-radius: 6px;
  font-size: 9px;
  font-weight: bold;
  height: 32px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 3px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.ti84-calc-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.ti84-calc-button:hover::before {
  left: 100%;
}

/* Number buttons - White/Light Gray */
.ti84-calc-button.number {
  background: linear-gradient(145deg, #f8f8f8 0%, #e8e8e8 50%, #d8d8d8 100%);
  color: #000;
  border-color: #bbb;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  font-weight: 900;
}

.ti84-calc-button.number:hover {
  background: linear-gradient(145deg, #fff, #e0e0e0);
}

.ti84-calc-button.number:active {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Operation buttons - Light gray (parentheses, etc.) */
.ti84-calc-button.operation {
  background: linear-gradient(145deg, #e8e8e8 0%, #d0d0d0 50%, #c0c0c0 100%);
  color: #000;
  border-color: #999;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  font-weight: 900;
}

.ti84-calc-button.operation:hover {
  background: linear-gradient(145deg, #f0f0f0, #d0d0d0);
}

/* Function buttons - Blue (Math functions) */
.ti84-calc-button.function {
  background: linear-gradient(145deg, #4a9eff 0%, #357abd 50%, #2563eb 100%);
  color: white;
  border-color: #1d4ed8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-weight: 900;
}

.ti84-calc-button.function:hover {
  background: linear-gradient(145deg, #5aa0f2, #4080cd);
}

/* Special buttons - Yellow/Orange (2nd, mode, etc.) */
.ti84-calc-button.special {
  background: linear-gradient(145deg, #ffb347 0%, #ff8c00 50%, #ff7700 100%);
  color: #000;
  font-weight: 900;
  border-color: #e67e00;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

.ti84-calc-button.special:hover {
  background: linear-gradient(145deg, #ffb520, #ff9c10);
}

/* Memory buttons - Green (Top row) */
.ti84-calc-button.memory {
  background: linear-gradient(145deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
  color: white;
  font-size: 8px;
  height: 24px;
  border-color: #166534;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-weight: 900;
}

.ti84-calc-button.memory:hover {
  background: linear-gradient(145deg, #60d888, #4ec380);
}

/* Operation buttons - Red/Orange (+ - * / =) */
.ti84-calc-button.equals {
  background: linear-gradient(145deg, #ff6b47 0%, #ff4444 50%, #ee3333 100%);
  color: white;
  font-weight: 900;
  border-color: #dc2626;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.ti84-calc-button.equals:hover {
  background: linear-gradient(145deg, #ff7b7b, #ff6262);
}

/* Realistic button interactions */
.ti84-calc-button:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 3px rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

.ti84-calc-button:active {
  transform: translateY(2px);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 -1px 2px rgba(255, 255, 255, 0.1);
  transition: all 0.05s ease;
}

/* Click animation */
.ti84-calc-button.clicked {
  animation: buttonClick 0.15s ease;
}

@keyframes buttonClick {
  0% { transform: translateY(0); }
  50% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

/* Arrow/navigation buttons */
.ti84-calc-button.arrow {
  background: linear-gradient(145deg, #666, #444);
  color: #ddd;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
}

/* Footer */
.ti84-footer {
  text-align: center;
  font-size: 6px;
  color: #888;
  margin-top: 8px;
  font-style: italic;
}

/* Responsive adjustments - Mobile */
@media (max-width: 480px) {
  .ti84-calculator-container {
    padding: 10px;
  }
  
  .ti84-main-container {
    width: 240px;
    height: 480px;
    padding: 16px;
    transform: none;
  }
  
  .ti84-calc-button {
    height: 28px;
    font-size: 8px;
  }
  
  .ti84-screen {
    height: 80px;
    font-size: 11px;
  }
}

/* Desktop enhancement */
@media (min-width: 768px) {
  .ti84-main-container {
    width: 280px;
    height: 560px;
    padding: 22px;
  }
  
  .ti84-calc-button {
    height: 36px;
    font-size: 11px;
  }
  
  .ti84-screen {
    height: 100px;
    font-size: 13px;
  }
  
  .ti84-branding .ti84-model {
    font-size: 16px;
  }
}

/* Dark theme adjustments */
.dark .ti84-main-container {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border-color: #0f3460;
}

.dark .ti84-calc-button.number {
  background: linear-gradient(145deg, #e8e8e8, #c8c8c8);
}

.dark .ti84-calc-button.operation {
  background: linear-gradient(145deg, #d0d0d0, #b0b0b0);
}

/* Animation for button presses */
@keyframes buttonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.ti84-calc-button:active {
  animation: buttonPress 0.1s ease;
}

/* Branding colors */
.texas-instruments {
  color: #003366;
  font-weight: bold;
}