/* ATmega328P Page Styles */

.atmega328p-section {
  min-height: 100vh;
  padding: 100px 0 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.atmega328p-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.atmega328p-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin-bottom: 30px;
  animation: fadeInUp 0.6s ease-out;
}

.atmega328p-card h1 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 2.5rem;
  text-align: center;
}

.atmega328p-card h1 i {
  color: #667eea;
  margin-right: 15px;
}

.subtitle {
  text-align: center;
  color: #7f8c8d;
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* Register Table Styles */
.register-table-wrapper {
  margin: 30px 0;
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.register-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.9rem;
  min-width: 900px;
}

.register-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.register-table th {
  padding: 15px 10px;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
}

.register-table tbody tr {
  transition: all 0.3s ease;
}

.register-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.register-table tbody tr:hover {
  background: #e3f2fd;
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.register-table td {
  padding: 12px 10px;
  text-align: center;
  border: 1px solid #e0e0e0;
}

.register-name {
  font-weight: 700;
  color: #667eea;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  background: #f0f4ff;
}

.register-addr {
  font-family: 'Courier New', monospace;
  color: #764ba2;
  font-weight: 600;
  background: #faf0ff;
}

.bit-cell {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.85rem;
}

.bit-cell.empty {
  color: #bdc3c7;
  font-weight: 400;
}

/* Explanation Card */
.explanation-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.8s ease-out;
}

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

.explanation-card h2 i {
  color: #764ba2;
  margin-right: 15px;
}

.explanation-content {
  color: #34495e;
  line-height: 1.8;
  font-size: 1rem;
}

.explanation-content p {
  margin-bottom: 20px;
}

/* Operations Grid */
.operations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.operation-item {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  padding: 25px;
  border-left: 5px solid #667eea;
  transition: all 0.3s ease;
}

.operation-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  border-left-color: #764ba2;
}

.operation-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.operation-header i {
  font-size: 1.5rem;
  color: #667eea;
  margin-right: 12px;
}

.operation-header h4 {
  margin: 0;
  color: #2c3e50;
  font-weight: 600;
  font-size: 1.2rem;
}

.operation-item code {
  display: block;
  background: #2c3e50;
  color: #ecf0f1;
  padding: 12px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin: 15px 0;
  overflow-x: auto;
  white-space: nowrap;
}

.op-description {
  color: #34495e;
  font-size: 0.95rem;
  margin: 10px 0;
}

.example {
  margin-top: 15px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  border-left: 3px solid #764ba2;
}

.example strong {
  color: #764ba2;
  display: block;
  margin-bottom: 5px;
}

.example code {
  background: transparent;
  color: #2c3e50;
  padding: 0;
  font-size: 0.9rem;
  margin: 0;
}

.example-desc {
  color: #7f8c8d;
  font-size: 0.85rem;
  font-style: italic;
}

/* Register Categories */
.register-categories {
  margin: 40px 0;
  padding: 30px;
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  border-radius: 12px;
}

.register-categories h3 {
  color: #2c3e50;
  margin-bottom: 25px;
  font-weight: 700;
  font-size: 1.5rem;
}

.register-categories h3 i {
  color: #e74c3c;
  margin-right: 10px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.category-item {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.category-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.category-item h5 i {
  color: #e74c3c;
  margin-right: 8px;
}

.category-item p {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin: 0;
  font-family: 'Courier New', monospace;
}

/* Tips Section */
.tips-section {
  margin: 40px 0;
  padding: 30px;
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  border-radius: 12px;
}

.tips-section h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 1.5rem;
}

.tips-section h3 i {
  color: #f39c12;
  margin-right: 10px;
}

.tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tips-list li {
  padding: 15px 20px;
  margin-bottom: 15px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #f39c12;
  color: #34495e;
  line-height: 1.6;
  transition: all 0.3s ease;
}

.tips-list li:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tips-list li strong {
  color: #2c3e50;
  display: block;
  margin-bottom: 5px;
}

.tips-list li code {
  background: #ecf0f1;
  color: #e74c3c;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .atmega328p-card {
    padding: 25px 15px;
  }
  
  .atmega328p-card h1 {
    font-size: 1.8rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .register-table {
    font-size: 0.75rem;
  }
  
  .register-table th,
  .register-table td {
    padding: 8px 5px;
  }
  
  .operations-grid {
    grid-template-columns: 1fr;
  }
  
  .category-grid {
    grid-template-columns: 1fr;
  }
  
  .explanation-card {
    padding: 25px 15px;
  }
  
  .explanation-card h2 {
    font-size: 1.5rem;
  }
  
  .register-categories,
  .tips-section {
    padding: 20px 15px;
  }
}

@media (max-width: 480px) {
  .atmega328p-card h1 {
    font-size: 1.5rem;
  }
  
  .atmega328p-card h1 i {
    display: block;
    margin-bottom: 10px;
  }
  
  .register-table {
    font-size: 0.7rem;
    min-width: 700px;
  }
  
  .operation-item code {
    font-size: 0.75rem;
  }
}
