/* Modern Tool Design System */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #4facfe;
  --background-dark: #0f0f1e;
  --background-light: #f8f9fa;
  --card-background: #ffffff;
  --text-color: #1e293b;
  --text-light: #64748b;
  --text-white: #ffffff;
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 12px 40px rgba(102, 126, 234, 0.2);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
  min-height: 100vh;
  color: var(--text-color);
  line-height: 1.6;
  padding: 2rem 1rem;
  position: relative;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
  z-index: -1;
}

/* Header Styles */
header {
  background: var(--card-background);
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  text-align: center;
}

header nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

header nav ul li a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 50px;
}

header nav ul li a:hover {
  background: var(--primary-gradient);
  color: var(--text-white);
  transform: translateY(-2px);
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card-background);
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--primary-gradient);
}

/* Typography */
h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin: 2rem 0 1rem;
  font-weight: 700;
}

p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Form Elements */
label {
  display: block;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--background-light);
  color: var(--text-color);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Courier New', monospace;
}

/* Color Inputs */
input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 60px;
  height: 40px;
  border: none;
  cursor: pointer;
  background-color: transparent;
  border-radius: var(--border-radius-sm);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border-radius: var(--border-radius-sm);
  border: 2px solid rgba(102, 126, 234, 0.2);
}

input[type="color"]::-moz-color-swatch {
  border-radius: var(--border-radius-sm);
  border: 2px solid rgba(102, 126, 234, 0.2);
}

/* Buttons */
button,
.btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

button:not(.secondary),
.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:not(.secondary):hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:not(.secondary):active,
.btn-primary:active {
  transform: translateY(0);
}

button.secondary,
.btn-secondary {
  background: var(--background-light);
  color: var(--text-color);
  border: 2px solid rgba(102, 126, 234, 0.2);
}

button.secondary:hover,
.btn-secondary:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Controls Group */
.controls {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.control-group {
  flex: 1;
  min-width: 200px;
}

.color-inputs {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Output/Preview Areas */
.output,
.preview {
  background: var(--background-light);
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  margin: 1.5rem 0;
  border: 2px solid rgba(102, 126, 234, 0.1);
}

.preview {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Code Display */
pre,
code {
  font-family: 'Courier New', Consolas, Monaco, monospace;
  background: var(--background-dark);
  color: #a8dadc;
  padding: 1.5rem;
  border-radius: var(--border-radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

code {
  padding: 0.2rem 0.4rem;
  display: inline;
}

/* Success/Error Messages */
.message {
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-sm);
  margin: 1rem 0;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.message.info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--text-white);
  animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .container {
    padding: 2rem 1.5rem;
  }

  .controls {
    flex-direction: column;
  }

  .control-group {
    width: 100%;
  }

  header nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none;
}

.fade-in {
  animation: fadeIn 0.5s ease;
}
