/* Fold Money Design System - Spending Budget Limit Feature */

:root {
  /* Colors based on Fold Money design */
  --primary-blue: #2563eb;
  --primary-blue-light: #3b82f6;
  --primary-blue-dark: #1d4ed8;
  --secondary-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Device Preview */
.device-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-6);
  background: #000000;
  position: relative;
}

.device-toolbar {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
}

.device-toolbar__left {
  display: none;
}

.device-toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.device-toolbar__right .hint {
  display: none;
}

.chip {
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chip--active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.9);
}

/* Device Frame */
.device {
  width: 375px;
  height: 812px;
  background: var(--bg-primary);
  border-radius: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  border: 8px solid #000000;
}

.device--android {
  border-radius: 24px;
  height: 800px;
}

.device--android .device__notch {
  display: none;
}

.device__bezel {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--bg-primary);
  border-radius: inherit;
  overflow: hidden;
}

.device__screen {
  width: 100%;
  height: 100%;
  position: relative;
  background: var(--bg-primary);
  border-radius: inherit;
}

.device__notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 30px;
  background: #000;
  border-radius: 0 0 16px 16px;
  z-index: 10;
}

/* App Layout */
.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}


.app__main {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
}

/* Sections */
.section {
  margin-bottom: var(--space-8);
}

.section__header {
  margin-bottom: var(--space-6);
}

.section__title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.section__subtitle {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Cards */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.card__header {
  margin-bottom: var(--space-6);
}

.card__title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.card__subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Labels and Form Elements */
.label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Search */
.search-wrapper {
  position: relative;
  margin-bottom: var(--space-4);
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-lg);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-10);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  background: var(--bg-primary);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Categories */
.categories-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.category-card {
  display: flex;
  align-items: flex-start;
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  overflow: hidden;
}

.category-card:hover {
  border-color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

.category-card--selected {
  border-color: #000000;
  background: rgba(0, 0, 0, 0.05);
}

.category-radio {
  margin-right: var(--space-4);
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-medium);
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease;
}

.category-card--selected .category-radio {
  border-color: #000000;
  background: #000000;
}

.category-card--selected .category-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.category-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.category-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.category-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.subcategories {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-2) 0;
  margin: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.subcategories::-webkit-scrollbar {
  display: none;
}

.subcategory {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-width: 60px;
  flex-shrink: 0;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.subcategory:hover {
  background: var(--bg-tertiary);
}

.subcategory--selected {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid #000000;
}

.subcategory--selected .subcategory-icon {
  background: #000000;
  color: white;
  filter: none;
}

.subcategory--selected .subcategory-label {
  color: #000000;
  font-weight: 600;
}

.subcategory-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  color: var(--text-muted);
  filter: grayscale(100%);
}

.subcategory-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

/* Form Groups */
.form-group {
  margin-bottom: var(--space-6);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  z-index: 1;
}

.input {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  background: var(--bg-primary);
  transition: border-color 0.2s ease;
}

.input--amount {
  padding-left: var(--space-10);
}

.input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Period Selector */
.period-selector {
  display: flex;
  gap: var(--space-2);
  background: var(--bg-tertiary);
  padding: var(--space-1);
  border-radius: var(--radius-lg);
}

.period-btn {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-btn--active,
.period-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Alert Settings */
.alert-settings {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.alert-info {
  flex: 1;
}

.alert-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.alert-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-medium);
  transition: 0.3s;
  border-radius: var(--radius-full);
}

.toggle__slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle__slider {
  background-color: var(--primary-blue);
}

.toggle input:checked + .toggle__slider:before {
  transform: translateX(20px);
}

/* Buttons */
.actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.btn {
  flex: 1;
  padding: var(--space-4) var(--space-6);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn--primary {
  background: #1f2937;
  color: white;
  font-weight: 600;
  font-size: var(--font-size-base);
}

.btn--primary:hover:not(:disabled) {
  background: #111827;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--primary:disabled {
  background: var(--border-medium);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn--ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .device-preview {
    padding: var(--space-4);
  }
  
  .device {
    width: 100%;
    max-width: 375px;
    height: 100vh;
    max-height: 812px;
  }
  
  .device--android {
    height: 100vh;
    max-height: 800px;
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animations */
.category-card {
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar styling */
.subcategories::-webkit-scrollbar {
  height: 4px;
}

.subcategories::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

.subcategories::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

.subcategories::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
