/* IEEE 754 Converter Styling */

.ieee754-section {
  min-height: calc(100vh - 200px);
  padding: 120px 0 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
}

.ieee754-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.ieee754-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.15);
  padding: 50px;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease;
}

.ieee754-card h1 {
  color: #2e3537;
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.ieee754-card .subtitle {
  color: #6c757d;
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

/* Input Section */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.input-group-ieee label {
  display: block;
  color: #394245;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1rem;
}

.ieee-input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e1e8ed;
  border-radius: 10px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.ieee-input:focus {
  outline: none;
  border-color: #09afdf;
  box-shadow: 0 0 0 3px rgba(9, 175, 223, 0.1);
}

.precision-selector label {
  display: block;
  color: #394245;
  font-weight: 600;
  margin-bottom: 10px;
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 1rem;
  color: #394245;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.btn-convert {
  background: linear-gradient(135deg, #09afdf 0%, #0c9ec7 100%);
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(9, 175, 223, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-convert:hover {
  background: linear-gradient(135deg, #0c9ec7 0%, #0889a8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(9, 175, 223, 0.4);
}

.btn-convert i {
  margin-right: 8px;
}

/* Results Section */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-item label {
  display: block;
  color: #394245;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.result-display {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: #2e3537;
  border: 2px solid #e1e8ed;
  word-break: break-all;
}

.bit-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bit-part {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  border: 2px solid #e1e8ed;
}

.bit-part.sign {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
  border-color: #ffcccb;
}

.bit-part.exponent {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}

.bit-part.mantissa {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #bbf7d0;
}

.bit-label {
  font-weight: 600;
  color: #394245;
  font-size: 0.9rem;
}

.bit-value {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: #2e3537;
}

/* Steps Section */
.steps-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 2px solid #e1e8ed;
}

.steps-section h3 {
  color: #2e3537;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step {
  display: flex;
  gap: 20px;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #09afdf;
}

.step.special {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-left-color: #fb923c;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #09afdf 0%, #0c9ec7 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.step-content h4 {
  color: #2e3537;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.step-content p {
  color: #394245;
  line-height: 1.6;
  margin-bottom: 8px;
}

.step-note {
  font-style: italic;
  color: #6c757d;
  font-size: 0.95rem;
}

.final-representation {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.repr-part {
  flex: 1;
  min-width: 150px;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.sign-bg {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.exponent-bg {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.mantissa-bg {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

.repr-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #394245;
  margin-bottom: 8px;
}

.repr-value {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #2e3537;
  word-break: break-all;
}

/* Explanation Card */
.explanation-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.15);
  padding: 50px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.explanation-card h2 {
  color: #2e3537;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 25px;
}

.explanation-card h4 {
  color: #394245;
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 15px;
}

.explanation-content p {
  color: #394245;
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.info-item {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease;
}

.info-item:hover {
  transform: translateY(-5px);
}

.info-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.info-icon i {
  font-size: 1.8rem;
  color: white;
}

.sign-color {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
}

.exponent-color {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
}

.mantissa-color {
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
}

.info-item h5 {
  color: #2e3537;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.info-item p {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.6;
}

.formula-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #bae6fd;
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
  text-align: center;
}

.formula-box p {
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  color: #2e3537;
  margin: 0;
  font-weight: 600;
}

.explanation-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.explanation-list li {
  padding: 12px 0 12px 30px;
  position: relative;
  color: #394245;
  line-height: 1.6;
}

.explanation-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #09afdf;
  font-size: 1.2rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 968px) {
  .converter-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .ieee754-card {
    padding: 30px;
  }
  
  .explanation-card {
    padding: 30px;
  }
  
  .ieee754-card h1 {
    font-size: 2rem;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
}
