/* Base Styles */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #f3f4f6;
  --secondary-hover: #e5e7eb;
  --text: #374151;
  --text-light: #6b7280;
  --background: #ffffff;
  --border: #d1d5db;
  --card: #ffffff;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 0.5rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition: all 0.2s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f9fafb;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit;
}

/* Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.logo-text {
  color: var(--text);
}

.logo-highlight {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 0.5rem;
}

.main-content {
  margin-bottom: 2rem;
}

/* Cards */
.card {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}

.glass {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(209, 213, 219, 0.3);
}

.card-content {
  padding: 1.5rem;
}

/* Tabs */
.tab-button {
  padding: 0.5rem 1rem;
  background-color: var(--secondary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.tab-button:hover {
  background-color: var(--secondary-hover);
}

.tab-button.active {
  background-color: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

/* Password Generator */
.password-display-container {
  margin-bottom: 1.5rem;
}

.password-field {
  display: flex;
  align-items: center;
  background-color: var(--secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
  overflow: hidden;
}

.password-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.password-output {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  outline: none;
  font-family: monospace;
  font-size: 1.125rem;
  letter-spacing: 0.05em;
}

.password-actions {
  display: flex;
  gap: 0.25rem;
  padding-right: 0.5rem;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-light);
}

.icon-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.icon-button.small svg {
  width: 1rem;
  height: 1rem;
}

.platform-section {
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.platform-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
  gap: 0.5rem;
}

.platform-button {
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.75rem;
  text-align: center;
}

.platform-button:hover {
  background-color: var(--secondary-hover);
}

.platform-button.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.custom-mode-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.password-options {
  margin-bottom: 1.5rem;
}

.length-slider {
  margin-bottom: 1.5rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.slider {
  width: 100%;
  height: 0.5rem;
  background-color: var(--secondary);
  border-radius: 9999px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.slider::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.option-toggles {
  margin-top: 1.5rem;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.toggle-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  background-color: white;
  cursor: pointer;
}

.toggle-example {
  font-size: 0.75rem;
  color: var(--text-light);
}

.generator-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
}

.button svg {
  width: 1rem;
  height: 1rem;
}

.button.primary {
  background-color: var(--primary);
  color: white;
}

.button.primary:hover {
  background-color: var(--primary-hover);
}

.button.secondary {
  background-color: var(--secondary);
  color: var(--text);
}

.button.secondary:hover {
  background-color: var(--secondary-hover);
}

.password-history {
  margin-top: 2rem;
  background-color: var(--secondary);
  border-radius: var(--radius);
  padding: 1rem;
}

.password-history h3 {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.history-list {
  max-height: 8rem;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.25rem;
}

.history-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.history-password {
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

/* Password Checker */
.password-check-container {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.password-input {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  outline: none;
  transition: var(--transition);
  font-size: 1.125rem;
}

.password-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.alert svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.alert p {
  font-size: 0.875rem;
  line-height: 1.4;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.alert-danger svg {
  color: #ef4444;
}

.strength-section {
  margin-bottom: 1.5rem;
}

.strength-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.strength-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.strength-label svg {
  width: 1.125rem;
  height: 1.125rem;
}

.strength-score {
  font-size: 0.75rem;
  font-weight: 500;
}

.strength-meter {
  height: 0.5rem;
  background-color: var(--secondary);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.strength-meter-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease-in-out, background-color 0.5s ease-in-out;
}

.bg-gray-200 {
  background-color: #e5e7eb;
}

.bg-red-500 {
  background-color: #ef4444;
}

.bg-orange-500 {
  background-color: #f97316;
}

.bg-yellow-500 {
  background-color: #eab308;
}

.bg-green-400 {
  background-color: #34d399;
}

.bg-green-600 {
  background-color: #059669;
}

.crack-time-container {
  margin-top: 1rem;
}

.crack-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.crack-time svg {
  width: 1rem;
  height: 1rem;
}

.password-analysis {
  margin-top: 1.5rem;
  background-color: #f9fafb;
  border-radius: var(--radius);
  padding: 1rem;
}

.password-analysis h3 {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.password-checks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.password-check-item {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.check-status {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.check-pass {
  background-color: #34d399;
  color: white;
}

.check-fail {
  background-color: #e5e7eb;
}

.check-icon {
  width: 0.625rem;
  height: 0.625rem;
}

.check-text {
  flex: 1;
}

/* Tips Section */
.tips-section {
  margin-top: 2rem;
}

.tips-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.tips-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.tip-card {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border-top: 3px solid var(--primary);
}

.tip-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.tip-card p {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Tooltips */
.tooltip-container {
  position: relative;
}

.tooltip {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 200px;
  max-width: 300px;
  background-color: #374151;
  color: white;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  z-index: 10;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 10px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #374151;
}

.tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip p {
  margin: 0;
  line-height: 1.4;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background-color: #374151;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--error);
}

/* Helper classes */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Responsive design */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .generator-actions {
    flex-direction: column;
  }
  
  .tips-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .platform-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}
