/* ═══════════════════════════════════════════════════════
   🔐 VAULT - Professional Black & White Dark Theme
   ═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────── */
/* CSS Variables - Design Tokens */
/* ─────────────────────────────────────────────────────── */

:root {
  /* Color Palette - Black & White Theme */
  --color-bg-primary: #0a0a0a;
  --color-bg-secondary: #111111;
  --color-bg-tertiary: #1a1a1a;
  --color-bg-card: #141414;
  --color-bg-input: #0f0f0f;
  --color-bg-hover: #1f1f1f;
  
  /* Accent Colors - Monochrome */
  --color-accent-primary: #ffffff;
  --color-accent-secondary: #e5e5e5;
  --color-accent-glow: rgba(255, 255, 255, 0.1);
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: #d4d4d4;
  --color-text-muted: #737373;
  --color-text-disabled: #525252;
  
  /* Border Colors */
  --color-border: #262626;
  --color-border-focus: #404040;
  --color-border-input: #1f1f1f;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 10px 10px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.1);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────────────── */
/* Reset & Base Styles */
/* ─────────────────────────────────────────────────────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Subtle grid background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* Vignette effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ─────────────────────────────────────────────────────── */
/* Typography */
/* ─────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────────────── */
/* Layout Components */
/* ─────────────────────────────────────────────────────── */

.app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.container-wide {
  max-width: 1000px;
}

/* ─────────────────────────────────────────────────────── */
/* Card Component */
/* ─────────────────────────────────────────────────────── */

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.card:hover {
  border-color: #303030;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* ─────────────────────────────────────────────────────── */
/* Header Component */
/* ─────────────────────────────────────────────────────── */

.header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.header-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  display: inline-block;
  filter: grayscale(1);
  opacity: 0.9;
}

.header-subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─────────────────────────────────────────────────────── */
/* Form Elements */
/* ─────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: var(--space-xl);
}

label {
  display: block;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  transition: all var(--transition-base);
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--color-border-focus);
  background: var(--color-bg-secondary);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
  color: var(--color-text-disabled);
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.7;
  font-size: 0.9375rem;
}

/* ─────────────────────────────────────────────────────── */
/* Button Component */
/* ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button Variants */
.btn-primary {
  background: var(--color-text-primary);
  color: var(--color-bg-primary);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--color-text-secondary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-focus);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-focus);
}

.btn-outline:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-text-primary);
}

.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ─────────────────────────────────────────────────────── */
/* Actions / Navigation */
/* ─────────────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* ─────────────────────────────────────────────────────── */
/* Editor Specific Styles */
/* ─────────────────────────────────────────────────────── */

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.editor-title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.editor-title h2 {
  margin: 0;
  font-size: 1.25rem;
}

.editor-actions {
  display: flex;
  gap: var(--space-sm);
}

.editor-container {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  min-height: 500px;
}

textarea#content {
  width: 100%;
  min-height: 500px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  padding: var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.8;
  resize: vertical;
}

/* ─────────────────────────────────────────────────────── */
/* Status Indicators */
/* ─────────────────────────────────────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─────────────────────────────────────────────────────── */
/* Alert/Message Component */
/* ─────────────────────────────────────────────────────── */

.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  animation: slideIn 0.3s ease-out;
  font-size: 0.9375rem;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-info {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
}

.alert-success {
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--color-success);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

.alert-error {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-error);
}

/* ─────────────────────────────────────────────────────── */
/* Loading Spinner */
/* ─────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-text-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ─────────────────────────────────────────────────────── */
/* Modal */
/* ─────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

/* ─────────────────────────────────────────────────────── */
/* Utility Classes */
/* ─────────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.875rem; }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ─────────────────────────────────────────────────────── */
/* Responsive Design */
/* ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .app {
    padding: var(--space-md);
  }
  
  .card {
    padding: var(--space-xl);
  }
  
  h1 {
    font-size: 2.25rem;
  }
  
  .editor-header {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }
  
  .editor-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .card {
    padding: var(--space-lg);
  }
  
  .header-icon {
    font-size: 3rem;
  }
}

/* ─────────────────────────────────────────────────────── */
/* Print Styles */
/* ─────────────────────────────────────────────────────── */

@media print {
  body::before,
  body::after {
    display: none;
  }
  
  .btn,
  .actions,
  .editor-actions {
    display: none;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}