/* TinyTools - Common Design System */
/* Brand Colors */
:root {
  --primary-color: #23c16b;
  --primary-hover: #1ea45e;
  --primary-light: #e8f8f0;
  --background: #f5f7fa;
  --surface: #ffffff;
  --text-primary: #222222;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --border-color: #e0e4e8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 0.3s ease;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1 {
  color: var(--primary-color);
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

h2 {
  color: var(--text-primary);
  font-size: 1.6em;
  font-weight: 600;
  margin-bottom: 1rem;
}

h3 {
  color: var(--text-primary);
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-secondary);
  font-size: 1em;
  margin-bottom: 1rem;
  text-align: center;
}

/* Header */
.header {
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  margin: 0;
}

.header p {
  margin: 10px 0 0 0;
  color: var(--text-secondary);
}

/* Navigation */
.nav {
  background: var(--surface);
  padding: 15px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 0 auto 30px;
  max-width: 1200px;
  width: calc(100% - 40px);
}

.nav-list {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 600;
  border: 2px solid var(--primary-color);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-block;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-color);
  color: white;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.card {
  background: var(--surface);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

/* Form Elements */
input[type="file"],
input[type="text"],
input[type="number"],
select {
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  transition: var(--transition);
  width: 100%;
  max-width: 400px;
}

input[type="file"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Buttons */
button,
.btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

button:hover,
.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button:active,
.btn:active {
  transform: translateY(0);
}

button:disabled,
.btn:disabled {
  background: var(--border-color);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-light);
}

/* Checkboxes & Radio */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Range Sliders */
input[type="range"] {
  width: 100%;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Sections */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

/* Grid System */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Footer */
.footer {
  background: var(--surface);
  text-align: center;
  padding: 40px 20px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

.footer p {
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.footer a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

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

/* Canvas & Images */
canvas,
img {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

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

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.hidden {
  display: none;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-column {
  flex-direction: column;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

/* Mobile Navigation Toggle */
.nav-toggle {
  display: none;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-toggle::after {
  content: '▼';
  float: right;
  transition: transform 0.3s;
}

.nav-toggle.active::after {
  transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .card {
    padding: 20px;
  }

  h1 {
    font-size: 1.8em;
  }

  h2 {
    font-size: 1.4em;
  }

  .header {
    padding: 15px;
    margin-bottom: 15px;
  }

  /* Mobile Navigation */
  .nav {
    padding: 10px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0;
  }

  .nav-list.show {
    max-height: 500px;
    margin-top: 10px;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 14px;
  }

  input[type="file"],
  input[type="text"],
  input[type="number"],
  select {
    max-width: 100%;
  }

  button,
  .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
  }
}

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

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

/* Alert Messages */
.alert {
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}
