/**
 * Encrypt & Decrypt - GreenGetWare Theme
 */

:root {
  --primary: #39d353;
  --primary-dark: #176f3c;
  --primary-hover: #2fb344;
  --primary-light: rgba(57, 211, 83, 0.15);
  --primary-gradient: linear-gradient(135deg, #39d353 0%, #176f3c 100%);
  --accent: #00c9ff;
  --secondary: #64748b;
  --success: #39d353;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #252540;
  --bg-card: rgba(26, 26, 46, 0.9);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.08);
  
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px rgba(57, 211, 83, 0.2);
  
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header */
.app-header {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo i {
  color: var(--primary);
  font-size: 1.75rem;
}

.brand-badge {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--primary);
  color: white;
}

.btn-home {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.3);
  transition: all var(--transition-fast);
}

.btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(57, 211, 83, 0.4);
  color: white;
}

.btn-home span {
  display: none;
}

@media (min-width: 768px) {
  .btn-home span {
    display: inline;
  }
}

/* Main Content */
.main-content {
  padding: var(--space-xl) 0;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.hero-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-gradient);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  box-shadow: var(--shadow-glow);
}

.hero-icon i {
  font-size: 2.5rem;
  color: white;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.hero-section p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mode-btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 20px rgba(57, 211, 83, 0.3);
}

.mode-btn i {
  font-size: 1.25rem;
}

/* Main Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 350px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Section Card */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  height: 100%;
}

.section-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.section-card .card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-card .card-header h3 i {
  color: var(--primary);
}

.header-actions-card {
  display: flex;
  gap: var(--space-xs);
}

.card-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.card-btn:hover {
  background: var(--primary);
  color: white;
}

.section-card .card-body {
  padding: var(--space-lg);
}

.section-card textarea {
  width: 100%;
  min-height: 250px;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.section-card textarea:focus {
  border-color: var(--primary);
}

.section-card textarea::placeholder {
  color: var(--text-muted);
}

.text-stats,
.output-info {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.text-stats span,
.output-info span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* Settings Section */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--space-lg);
}

.settings-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.settings-card h4 i {
  color: var(--primary);
}

/* Algorithm Grid */
.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
  max-height: 300px;
  overflow-y: auto;
}

.algo-btn {
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.algo-btn:hover {
  border-color: var(--primary);
}

.algo-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

.algo-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.algo-desc {
  display: block;
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Key Input */
.key-input-wrapper {
  position: relative;
  margin-bottom: var(--space-md);
}

.key-input-wrapper input {
  width: 100%;
  padding: var(--space-md);
  padding-right: 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.key-input-wrapper input:focus {
  border-color: var(--primary);
}

.toggle-visibility {
  position: absolute;
  right: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.toggle-visibility:hover {
  color: var(--primary);
}

/* Key Strength */
.key-strength {
  margin-bottom: var(--space-md);
}

.strength-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.strength-fill.weak { width: 25%; background: var(--danger); }
.strength-fill.fair { width: 50%; background: var(--warning); }
.strength-fill.good { width: 75%; background: var(--accent); }
.strength-fill.strong { width: 100%; background: var(--success); }

.strength-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.generate-key-btn {
  width: 100%;
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all var(--transition-fast);
}

.generate-key-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Caesar Shift */
.shift-control {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.shift-control input[type="range"] {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
}

.shift-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

.shift-value {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
  color: var(--primary);
}

/* Action Button */
.action-btn {
  width: 100%;
  padding: var(--space-lg);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all var(--transition-fast);
  box-shadow: 0 4px 20px rgba(57, 211, 83, 0.3);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(57, 211, 83, 0.4);
}

.action-btn i {
  font-size: 1.25rem;
}

/* Hash Section */
.hash-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-color);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.section-header h2 i {
  color: var(--primary);
}

.section-header p {
  color: var(--text-secondary);
}

.hash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
}

.hash-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.hash-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 60px;
}

.hash-value {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-hash {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.copy-hash:hover {
  background: var(--primary);
  color: white;
}

/* Features Section */
.features-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-color);
}

.features-section h2 {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xl);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.feature-icon i {
  font-size: 1.75rem;
  color: var(--primary);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Footer */
.app-footer {
  padding: var(--space-xl) 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2xl);
}

.app-footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 1.75rem;
  }
  
  .mode-toggle {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mode-btn {
    justify-content: center;
  }
  
  .algorithm-grid {
    grid-template-columns: 1fr;
  }
  
  .hash-grid {
    grid-template-columns: 1fr;
  }
}
