/* JPG Compressor Online - Main Styles */

/* Import Fonts */
@import url('../fonts/fonts.css');
@import url('../icons/icons.css');

/* CSS Variables - Grape/Purple Theme */
:root {
  /* Primary Colors - Grape/Purple */
  --primary-color: #8B5A96;
  --primary-light: #A67FB5;
  --primary-dark: #6B4C7A;
  --primary-gradient: linear-gradient(135deg, #8B5A96 0%, #A67FB5 100%);
  
  /* Secondary Colors */
  --secondary-color: #E8D5F2;
  --secondary-light: #F4EBFA;
  --secondary-dark: #D1B8E6;
  
  /* Accent Colors */
  --accent-color: #FF6B9D;
  --accent-light: #FFB3D1;
  --accent-dark: #E55A8A;
  
  /* Neutral Colors */
  --white: #FFFFFF;
  --light-gray: #F8F9FA;
  --gray: #6C757D;
  --dark-gray: #495057;
  --black: #212529;
  
  /* Success/Error Colors */
  --success-color: #28A745;
  --error-color: #DC3545;
  --warning-color: #FFC107;
  --info-color: #17A2B8;
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(139, 90, 150, 0.075);
  --shadow: 0 0.5rem 1rem rgba(139, 90, 150, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(139, 90, 150, 0.175);
  
  /* Border Radius */
  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
  --border-radius-xl: 1.5rem;
  
  /* Transitions */
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
  
  /* Fonts */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-secondary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--dark-gray);
  background-color: var(--white);
  margin: 0;
  padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Custom Bootstrap Overrides */
.btn-primary {
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: var(--border-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-outline-primary:hover {
  background: var(--primary-gradient);
  border-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-success {
  background: var(--success-color);
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
}

.btn-success:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Header Styles */
.navbar {
  background: var(--primary-gradient) !important;
  padding: 1rem 0;
  box-shadow: var(--shadow);
}

.navbar-brand {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white) !important;
}

.navbar-nav .nav-link {
  color: var(--white) !important;
  font-weight: 500;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white) !important;
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

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

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--white) 100%);
  padding: 2.5rem 0;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--dark-gray);
}

.hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-lg);
}

/* Tool Container */
.compression-tool {
  background: var(--light-gray);
}

.tool-container {
  background: var(--white);
  border-radius: var(--border-radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  margin: 1rem 0;
}

.tool-header h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.tool-header p {
  font-size: 1rem;
  color: var(--gray);
}

/* Upload Area */
.upload-area {
  border: 3px dashed var(--primary-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--secondary-light);
  transition: var(--transition);
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--primary-dark);
  background: var(--secondary-color);
}

.upload-area.dragover {
  border-color: var(--accent-color);
  background: var(--accent-light);
  transform: scale(1.02);
}

.upload-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.upload-content p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.upload-info {
  margin-top: 1rem;
}

.upload-info small {
  color: var(--gray);
  font-size: 0.875rem;
}

/* Compression Options */
.compression-options {
  background: var(--light-gray);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  margin-top: 2rem;
}

.option-group {
  margin-bottom: 1.5rem;
}

.option-group label {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  display: block;
}

.compression-presets {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: var(--white);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.preset-btn:hover,
.preset-btn.active {
  background: var(--primary-gradient);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quality-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quality-slider input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--secondary-color);
  outline: none;
  -webkit-appearance: none;
}

.quality-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-gradient);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.quality-slider input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-gradient);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
}

#qualityValue {
  font-weight: 600;
  color: var(--primary-dark);
  min-width: 40px;
}

/* Form Controls */
.form-select {
  border: 2px solid var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  font-size: 1rem;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(139, 90, 150, 0.25);
}

/* Comparison Container */
.comparison-container {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow);
}

.comparison-header {
  text-align: center;
  margin-bottom: 2rem;
}

.comparison-header h3 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.file-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.info-item {
  text-align: center;
}

.info-item .label {
  font-weight: 600;
  color: var(--gray);
  display: block;
  margin-bottom: 0.25rem;
}

.info-item span:last-child {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* Before/After Slider */
.before-after-slider {
  position: relative;
  margin: 2rem 0;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.slider-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: var(--light-gray);
}

.before-image,
.after-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.before-image {
  z-index: 1;
}

.after-image {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0.1s ease;
}

.before-image img,
.after-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
  display: block;
}

.image-label {
  position: absolute;
  top: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.875rem;
}

.before-image .image-label {
  left: 1rem;
}

.after-image .image-label {
  right: 1rem;
}

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: var(--white);
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 10;
}

.handle-line {
  width: 100%;
  height: calc(50% - 20px);
  background: var(--primary-color);
}

.handle-circle {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border: 3px solid var(--white);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.2rem;
  box-shadow: var(--shadow);
}

/* Features Section */
.features-section {
  padding: 2.5rem 0;
}

.features-section h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.features-section p {
  font-size: 1rem;
  color: var(--gray);
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
}

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

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
  color: var(--white);
}

.feature-card h4 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
}

.feature-card p {
  color: var(--gray);
  margin-bottom: 0;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer h5 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
  padding-top: 1rem;
  text-align: center;
  color: var(--secondary-color);
}

/* Language Selector */
.language-selector .dropdown-toggle {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--white);
}

.language-selector .dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.language-selector .dropdown-menu {
  max-height: 300px;
  overflow-y: auto;
  border: none;
  box-shadow: var(--shadow-lg);
}

.language-selector .dropdown-item.active {
  background: var(--primary-gradient);
  color: var(--white);
}

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

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid var(--secondary-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Progress Bar */
.progress-bar-custom {
  background: var(--primary-gradient);
  border-radius: var(--border-radius);
  transition: width 0.3s ease;
}

/* Alert Styles */
.alert-custom {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  margin: 1rem 0;
}

.alert-success-custom {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-error-custom {
  background: rgba(220, 53, 69, 0.1);
  color: var(--error-color);
  border-left: 4px solid var(--error-color);
}

.alert-warning-custom {
  background: rgba(255, 193, 7, 0.1);
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

.alert-info-custom {
  background: rgba(23, 162, 184, 0.1);
  color: var(--info-color);
  border-left: 4px solid var(--info-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .tool-container {
    padding: 1.5rem;
  }

  .upload-area {
    padding: 2rem 1rem;
  }

  .compression-presets {
    justify-content: center;
  }

  .file-info {
    flex-direction: column;
    gap: 1rem;
  }

  .feature-card {
    margin-bottom: 2rem;
  }

  .navbar-nav {
    text-align: center;
  }

  .language-selector {
    margin-top: 1rem;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .tool-header h2 {
    font-size: 2rem;
  }

  .features-section h2 {
    font-size: 2rem;
  }

  .compression-presets {
    flex-direction: column;
    align-items: center;
  }

  .preset-btn {
    width: 100%;
    max-width: 200px;
  }

  .slider-container {
    aspect-ratio: 4/3;
  }

  .handle-circle {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
}


/* Custom spacing overrides for better proportions */
.py-5 {
   padding-top: 2.5rem !important;
   padding-bottom: 2.5rem !important;
}

.py-4 {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

.mb-5 {
  margin-bottom: 2rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

/* Compression Tools Section */
.compression-tools-section {
  background: #f8f9fa;
}

.compression-tool-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 0.25rem 0.5rem rgba(139, 90, 150, 0.1);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid #e9ecef;
}

.compression-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(139, 90, 150, 0.15);
  border-color: var(--primary-color);
}

.tool-size-badge {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compression-tool-card h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.compression-tool-card p {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.compression-tool-card .btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

/* Drag and Drop States */
.upload-area.dragover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  transform: scale(1.02);
}

/* Download Button Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.btn-loading .fas.fa-spinner {
  animation: spin 1s linear infinite;
}

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

.upload-area:hover {
  border-color: var(--primary-color);
  background-color: var(--secondary-light);
}

/* Compression Settings Visibility */
.compression-options {
  transition: all 0.3s ease;
}

.comparison-container {
  transition: all 0.3s ease;
}

/* Duplicate CSS removed - using the main before/after slider styles above */

/* Image label styles are defined above in the main before/after slider section */

/* Slider handle styles are defined above in the main before/after slider section */

/* File Info */
.file-info {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Compression Stats */
.compression-stats {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Tool Pages Styling */
.tool-header-icon {
  font-size: 4rem;
  opacity: 0.9;
}

.feature-badges .badge {
  font-size: 0.875rem;
  font-weight: 500;
}

.tool-interface .upload-area {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-options,
.results-section {
  transition: all 0.3s ease;
}

.tool-info {
  background: #f8f9fa;
}

.tool-info h2 {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
}

.tool-info h3 {
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.tool-info ul {
  list-style: none;
  padding-left: 0;
}

.tool-info li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e9ecef;
}

.tool-info li:last-child {
  border-bottom: none;
}

/* Gradient backgrounds for different tool colors */
.bg-gradient-purple { background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%); }
.bg-gradient-indigo { background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%); }
.bg-gradient-orange { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }
.bg-gradient-teal { background: linear-gradient(135deg, #14B8A6 0%, #0F766E 100%); }
.bg-gradient-pink { background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%); }
.bg-gradient-red { background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); }
.bg-gradient-cyan { background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%); }
.bg-gradient-lime { background: linear-gradient(135deg, #84CC16 0%, #65A30D 100%); }
.bg-gradient-violet { background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%); }
.bg-gradient-amber { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }
.bg-gradient-emerald { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.bg-gradient-blue { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); }
.bg-gradient-dark { background: linear-gradient(135deg, #374151 0%, #1F2937 100%); }
