/* ==================== EMULATION CONFIG MODAL STYLES ==================== */

/* Overlay */
.emulation-config-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Container */
.emulation-config-modal {
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.emulation-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.emulation-config-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.emulation-config-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.emulation-config-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Body */
.emulation-config-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Status */
.config-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-icon {
  font-size: 48px;
  line-height: 1;
}

.status-text h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #ffffff;
}

.status-text p {
  margin: 0;
  font-size: 14px;
  color: #aaaaaa;
}

.status-text strong {
  color: #4fc3f7;
}

/* Action Buttons */
.config-action {
  display: flex;
  justify-content: center;
}

.btn-select-folder {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-select-folder:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-select-folder:active {
  transform: translateY(0);
}

.btn-select-folder:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Info Section */
.config-info {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.config-info h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-info ul {
  margin: 0 0 20px 0;
  padding-left: 20px;
  list-style: none;
}

.config-info ul li {
  margin-bottom: 8px;
  font-size: 14px;
  color: #cccccc;
  position: relative;
  padding-left: 20px;
}

.config-info ul li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
}

.config-info strong {
  color: #ffffff;
}

.config-info code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #4fc3f7;
}

.config-info p {
  margin: 0;
  font-size: 14px;
  color: #aaaaaa;
  line-height: 1.6;
}

/* Structure Tree */
.config-structure {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.config-structure h4 {
  margin: 0 0 16px 0;
  font-size: 15px;
  color: #ffffff;
}

.structure-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
}

.tree-item.tree-child {
  margin-left: 24px;
}

.tree-icon {
  font-size: 20px;
  line-height: 1;
}

.tree-name {
  flex: 1;
  color: #ffffff;
  font-size: 14px;
}

.tree-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

/* Actions */
.config-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-secondary {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Warning */
.config-warning {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 12px;
}

.warning-icon {
  font-size: 32px;
  line-height: 1;
}

.warning-text strong {
  display: block;
  margin-bottom: 8px;
  color: #ff9800;
  font-size: 15px;
}

.warning-text p {
  margin: 0;
  color: #ffb74d;
  font-size: 14px;
  line-height: 1.5;
}

/* Scrollbar */
.emulation-config-modal::-webkit-scrollbar {
  width: 8px;
}

.emulation-config-modal::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.emulation-config-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.emulation-config-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .emulation-config-modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
    max-height: 85vh;
  }
  
  .emulation-config-header {
    padding: 20px;
  }
  
  .emulation-config-header h2 {
    font-size: 20px;
  }
  
  .emulation-config-body {
    padding: 20px;
  }
  
  .config-status {
    flex-direction: column;
    text-align: center;
  }
  
  .btn-select-folder {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .emulation-config-overlay {
    padding: 0;
  }
  
  .emulation-config-modal {
    border-radius: 0;
    max-height: 100vh;
  }
  
  .tree-item.tree-child {
    margin-left: 12px;
  }
  
  .config-info ul li {
    font-size: 13px;
  }
}


/* ==================== TYPE SELECTION CARDS ==================== */

.config-type-selection {
  margin: 20px 0;
}

.config-type-selection h4 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 1rem;
}

.type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.type-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.type-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 0, 110, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(255, 0, 110, 0.2);
}

.type-card.selected {
  background: rgba(255, 0, 110, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
}

.type-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.type-card h4 {
  color: var(--text-primary);
  margin: 8px 0 4px;
  font-size: 1.1rem;
}

.type-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 4px 0 12px;
}

.type-description {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Config action button with dynamic text */
#folderTypeText {
  font-weight: 600;
  color: var(--primary);
}

/* Tree item for BIOS (can be hidden for Android) */
.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.tree-item.tree-child {
  padding-left: 24px;
}

/* Type badge in structure */
#typeBadge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  margin-left: auto;
}

/* Android-specific styling */
.type-card[data-type="android"] .type-icon {
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.type-card[data-type="android"].selected {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--secondary);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .type-cards {
    grid-template-columns: 1fr;
  }
  
  .type-card {
    padding: 16px;
  }
  
  .type-icon {
    font-size: 2.5rem;
  }
}