/*
================================================================================
ROMANCE WEAVER - DESIGN SYSTEM
Comprehensive branding and styling framework for modular frontend
================================================================================
*/

/* =============================================================================
   CSS CUSTOM PROPERTIES (CSS VARIABLES)
   Core design tokens for consistent theming across all modules
============================================================================= */

:root {
  /* PRIMARY COLORS - Romance Weaver Brand Palette */
  --primary-romance: #C2185B;      /* Deep rose - primary actions, links */
  --secondary-blush: #F8BBD0;      /* Soft blush - backgrounds, cards */
  --accent-navy: #303F9F;          /* Navy - contrast, headers, text */
  --luxury-gold: #FFD700;          /* Gold - premium features, highlights */
  
  /* EXTENDED PALETTE */
  --romance-dark: #8E0038;         /* Darker rose for hover states */
  --romance-light: #FCE4EC;        /* Lightest rose for subtle backgrounds */
  --blush-dark: #F48FB1;           /* Medium blush for borders */
  --navy-light: #5C6BC0;           /* Lighter navy for secondary text */
  
  /* SEMANTIC COLORS */
  --success-green: #4CAF50;        /* Completion states, success messages */
  --warning-amber: #FF9800;        /* Warnings, attention needed */
  --error-red: #F44336;            /* Errors, validation issues */
  --info-blue: #2196F3;           /* Information, tips */
  
  /* NEUTRAL GRAYS */
  --gray-50: #FAFAFA;              /* Lightest gray - page backgrounds */
  --gray-100: #F5F5F5;             /* Light gray - card backgrounds */
  --gray-200: #EEEEEE;             /* Borders, dividers */
  --gray-300: #E0E0E0;             /* Input borders */
  --gray-400: #BDBDBD;             /* Disabled states */
  --gray-500: #9E9E9E;             /* Secondary text */
  --gray-600: #757575;             /* Body text */
  --gray-700: #616161;             /* Headings */
  --gray-800: #424242;             /* Dark text */
  --gray-900: #212121;             /* Darkest text */
  
  /* TYPOGRAPHY SCALE */
  --font-family-display: 'Playfair Display', serif;  /* Elegant headings */
  --font-family-body: 'Open Sans', sans-serif;       /* Clean body text */
  --font-family-mono: 'SF Mono', 'Monaco', monospace; /* Code, technical */
  
  /* FONT SIZES - Type Scale */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px - body text */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  
  /* FONT WEIGHTS */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* SPACING SCALE */
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.25rem;      /* 20px */
  --space-6: 1.5rem;       /* 24px */
  --space-8: 2rem;         /* 32px */
  --space-10: 2.5rem;      /* 40px */
  --space-12: 3rem;        /* 48px */
  --space-16: 4rem;        /* 64px */
  --space-20: 5rem;        /* 80px */
  
  /* BORDER RADIUS */
  --radius-sm: 0.25rem;    /* 4px - small elements */
  --radius-base: 0.5rem;   /* 8px - standard radius */
  --radius-lg: 0.75rem;    /* 12px - cards */
  --radius-xl: 1rem;       /* 16px - modals */
  --radius-full: 9999px;   /* Full rounded - buttons, pills */
  
  /* SHADOWS - Depth System */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* ROMANTIC GRADIENTS */
  --gradient-romance: linear-gradient(135deg, var(--primary-romance) 0%, var(--romance-dark) 100%);
  --gradient-blush: linear-gradient(135deg, var(--secondary-blush) 0%, var(--blush-dark) 100%);
  --gradient-luxury: linear-gradient(135deg, var(--luxury-gold) 0%, #FFA726 100%);
  --gradient-dreamy: linear-gradient(135deg, var(--romance-light) 0%, var(--secondary-blush) 50%, var(--primary-romance) 100%);
  
  /* TRANSITIONS */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* BREAKPOINTS (for reference in media queries) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
}

/* =============================================================================
   RESET & BASE STYLES
   Modern CSS reset with Romance Weaver defaults
============================================================================= */

/* Box sizing reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins */
* {
  margin: 0;
  padding: 0;
}

/* HTML and body setup */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: 1.6;
  color: var(--gray-700);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   TYPOGRAPHY SYSTEM
   Consistent typography patterns for Romance Weaver
============================================================================= */

/* Display headings - Playfair Display for elegance */
.display-1 {
  font-family: var(--font-family-display);
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  line-height: 1.2;
  color: var(--accent-navy);
  letter-spacing: -0.025em;
}

.display-2 {
  font-family: var(--font-family-display);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  line-height: 1.25;
  color: var(--accent-navy);
  letter-spacing: -0.02em;
}

.display-3 {
  font-family: var(--font-family-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--accent-navy);
}

/* Standard headings */
h1, .h1 {
  font-family: var(--font-family-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--accent-navy);
  margin-bottom: var(--space-4);
}

h2, .h2 {
  font-family: var(--font-family-display);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  line-height: 1.4;
  color: var(--accent-navy);
  margin-bottom: var(--space-3);
}

h3, .h3 {
  font-family: var(--font-family-body);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: 1.4;
  color: var(--gray-800);
  margin-bottom: var(--space-3);
}

h4, .h4 {
  font-family: var(--font-family-body);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1.5;
  color: var(--gray-800);
  margin-bottom: var(--space-2);
}

/* Body text */
p {
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.text-large {
  font-size: var(--text-lg);
  line-height: 1.6;
}

.text-small {
  font-size: var(--text-sm);
  line-height: 1.5;
}

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

/* Text colors */
.text-primary { color: var(--primary-romance); }
.text-secondary { color: var(--gray-500); }
.text-success { color: var(--success-green); }
.text-warning { color: var(--warning-amber); }
.text-error { color: var(--error-red); }
.text-navy { color: var(--accent-navy); }
.text-gold { color: var(--luxury-gold); }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* =============================================================================
   MODULE-SPECIFIC THEMING
   Unique visual identity for each module
============================================================================= */

/* Dashboard Module - Warm Welcome */
.module-dashboard {
  --module-primary: var(--gradient-dreamy);
  --module-accent: var(--luxury-gold);
  --module-bg: var(--romance-light);
}

/* Book Management Module - Library Aesthetic */
.module-books {
  --module-primary: var(--accent-navy);
  --module-accent: var(--luxury-gold);
  --module-bg: var(--gray-50);
}

/* Character Management Module - Portrait Gallery */
.module-characters {
  --module-primary: var(--primary-romance);
  --module-accent: var(--secondary-blush);
  --module-bg: var(--romance-light);
}

/* Story Development Module - Blueprint/Manuscript */
.module-story {
  --module-primary: var(--accent-navy);
  --module-accent: var(--info-blue);
  --module-bg: var(--gray-100);
}

/* Content Generation Module - Active Writing */
.module-content {
  --module-primary: var(--success-green);
  --module-accent: var(--primary-romance);
  --module-bg: var(--gray-50);
}

/* Developmental Editor Module - Professional Review */
.module-editor {
  --module-primary: var(--warning-amber);
  --module-accent: var(--accent-navy);
  --module-bg: var(--gray-100);
}

/* Export & Publishing Module - Professional Publishing */
.module-export {
  --module-primary: var(--luxury-gold);
  --module-accent: var(--accent-navy);
  --module-bg: var(--gray-50);
}

/* =============================================================================
   COMPONENT STYLES
   Reusable UI components with Romance Weaver styling
============================================================================= */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-family-body);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: 1;
  border: none;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--gradient-romance);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary-blush);
  color: var(--accent-navy);
  border: 1px solid var(--blush-dark);
}

.btn-secondary:hover {
  background: var(--blush-dark);
  color: white;
}

.btn-luxury {
  background: var(--gradient-luxury);
  color: var(--accent-navy);
  font-weight: var(--font-semibold);
}

.btn-outline {
  background: transparent;
  color: var(--primary-romance);
  border: 2px solid var(--primary-romance);
}

.btn-outline:hover {
  background: var(--primary-romance);
  color: white;
}

/* Button sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-base);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* Romance-themed card variants */
.card-romance {
  border-left: 4px solid var(--primary-romance);
}

.card-luxury {
  border: 1px solid var(--luxury-gold);
  background: linear-gradient(145deg, white 0%, var(--romance-light) 100%);
}

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

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-base);
  transition: all var(--transition-base);
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-romance);
  box-shadow: 0 0 0 3px rgba(194, 24, 91, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-family-body);
}

/* Legacy navigation styles removed - using .navbar styles instead */

/* Stats cards for dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: white;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-base);
  text-align: center;
  transition: all var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-family: var(--font-family-display);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--primary-romance);
  display: block;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================================================
   UTILITY CLASSES
   Helper classes for common styling needs
============================================================================= */

/* Spacing utilities */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Layout utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Background utilities */
.bg-white { background-color: white; }
.bg-romance-light { background-color: var(--romance-light); }
.bg-blush { background-color: var(--secondary-blush); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }

/* Border utilities */
.border { border: 1px solid var(--gray-200); }
.border-romance { border-color: var(--primary-romance); }
.border-gold { border-color: var(--luxury-gold); }
.rounded { border-radius: var(--radius-base); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow utilities */
.shadow { box-shadow: var(--shadow-base); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* =============================================================================
   RESPONSIVE DESIGN
   Mobile-first responsive utilities
============================================================================= */

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .display-1 { font-size: var(--text-3xl); }
  .display-2 { font-size: var(--text-2xl); }
  .display-3 { font-size: var(--text-xl); }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  /* Legacy mobile navigation styles removed - using .navbar responsive styles instead */
}

/* =============================================================================
   ACCESSIBILITY
   Ensure WCAG AA compliance
============================================================================= */

/* Focus indicators */
*:focus {
  outline: 2px solid var(--primary-romance);
  outline-offset: 2px;
}

.btn:focus {
  outline: 2px solid var(--primary-romance);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-romance: #8E0038;
    --accent-navy: #1A237E;
    --gray-600: #000000;
  }
}

/* =============================================================================
   PRINT STYLES
   Optimize for printing/PDF export
============================================================================= */

@media print {
  .btn,
  .nav,
  .card:hover {
    box-shadow: none !important;
    transform: none !important;
  }
  
  .bg-romance-light,
  .bg-blush {
    background: white !important;
  }
  
  .text-primary {
    color: black !important;
  }
}

/* =============================================================================
   NAVIGATION STYLES
   Consistent navbar styling across all pages
============================================================================= */

/* Romance SaaS Navigation - Book Creator Style */
.navbar {
  background: linear-gradient(135deg, #c71585, #ff69b4);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: var(--space-6);
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
  color: white !important;
  text-decoration: none;
}

.navbar-brand:hover {
  color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: var(--font-medium);
  transition: color var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: white !important;
}

.navbar-nav .nav-link {
  margin: 0 var(--space-1);
}

.current-book-badge {
  background-color: #ffb6c1;
  color: #c71585;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Dropdown menu styling */
.dropdown-menu {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-base);
  box-shadow: var(--shadow-lg);
}

.dropdown-item {
  color: var(--gray-700);
  padding: var(--space-2) var(--space-4);
}

.dropdown-item:hover {
  background: var(--romance-light);
  color: var(--primary-romance);
}

/* Mobile navbar toggler */
.navbar-toggler {
  border: none;
  padding: var(--space-1) var(--space-2);
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}