/* Sol Pixel Canvas - Sun Theme Styling */

:root {
  /* Sun theme colors */
  --sun-gold: #FFD700;
  --sun-orange: #FFA500;
  --sun-amber: #FFBF00;
  --sun-warm: #FF8C00;
  --sun-glow: rgba(255, 215, 0, 0.3);
  
  /* Dark background with warm undertones */
  --bg-dark: #1a1a2e;
  --bg-darker: #0f0f23;
  --bg-card: #16213e;
  --bg-hover: #1f2b4d;
  
  /* Text */
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0b0;
  --text-muted: #707080;
  
  /* Accents */
  --accent-success: #4ade80;
  --accent-error: #f87171;
  --accent-info: #60a5fa;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Layout */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: var(--bg-darker);
  border-right: 1px solid rgba(255, 215, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Header */
.header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px var(--sun-gold));
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--sun-gold), var(--sun-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Sections */
.section {
  padding: var(--spacing-md);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sun-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--spacing-sm);
}

/* Wallet section */
.wallet-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
}

.wallet-address {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  color: var(--sun-amber);
}

.balance-display {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
  background: var(--bg-card);
  border-radius: var(--radius-md);
}

.balance-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.balance-value {
  font-weight: 600;
  color: var(--sun-gold);
}

.balance-token {
  font-size: 0.85rem;
  color: var(--sun-orange);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sun-gold), var(--sun-orange));
  color: var(--bg-darker);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--sun-glow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--sun-gold);
}

.btn-small {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

/* Color palette */
.color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--spacing-xs);
}

.color-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.color-btn:hover {
  transform: scale(1.1);
  z-index: 1;
}

.color-btn.selected {
  border-color: var(--sun-gold);
  box-shadow: 0 0 10px var(--sun-glow);
  transform: scale(1.15);
  z-index: 2;
}

/* Selection info */
.selection-info {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.coord-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.coord-value {
  font-family: 'Fira Code', monospace;
  font-size: 1.5rem;
  color: var(--sun-gold);
  font-weight: 600;
}

.current-color-display {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--bg-darker);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
}

#current-color {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navigation controls */
.nav-controls {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.coord-input-group {
  display: flex;
  gap: var(--spacing-xs);
  align-items: center;
  margin-top: var(--spacing-sm);
}

.coord-input {
  width: 60px;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  text-align: center;
}

.coord-input:focus {
  outline: none;
  border-color: var(--sun-gold);
}

/* Canvas container */
.canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#pixel-canvas {
  display: block;
  cursor: crosshair;
  background: var(--bg-dark);
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 35, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--sun-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: var(--spacing-md);
  color: var(--text-secondary);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.toast {
  padding: var(--spacing-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--sun-gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
  max-width: 300px;
}

.toast-error {
  border-left-color: var(--accent-error);
}

.toast-success {
  border-left-color: var(--accent-success);
}

.toast-info {
  border-left-color: var(--accent-info);
}

.toast.fade-out {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Network indicator */
.network-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.network-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Footer */
.footer {
  padding: var(--spacing-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: auto;
}

.footer a {
  color: var(--sun-gold);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-height: 40vh;
    overflow-y: auto;
  }
  
  .canvas-container {
    flex: 1;
    min-height: 60vh;
  }
}
