:root {
    --primary-color: #6e8efb;
    --primary-gradient: linear-gradient(135deg, #6e8efb, #a777e3);
    --secondary-color: #2ecc71;
    --text-dark: #2c3e50;
    --text-medium: #34495e;
    --text-light: #7f8c8d;
    --border-color: #eaeaea;
    --background-light: #f8f9fa;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition: all 0.2s ease;
  }
  
  /* Base Styles */
  .tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--text-medium);
    line-height: 1.6;
  }
  
  /* Header Styles */
  .tool-header {
    margin-bottom: 3rem;
    text-align: center;
  }
  
  .header-content {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
    max-width: 100%;
  }
  
  .icon-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    flex-shrink: 0;
  }
  
  .tool-header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
    line-height: 1.2;
  }
  
  .subtitle {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-top: 0.75rem;
    font-weight: 400;
  }
  
  /* Card Styles */
  .card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    overflow: hidden;
    border: none;
    transition: var(--transition);
  }
  
  .card:hover {
    box-shadow: var(--shadow-lg);
  }
  
  .card-header {
    padding: 1.5rem;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .card-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
  }
  
  .card-header i {
    color: var(--primary-color);
    font-size: 1.2rem;
  }
  
  .card-body {
    padding: 1.75rem;
  }
  
  /* Upload Section */
  .upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    background-color: #fafafa;
    position: relative;
  }
  
  .upload-area:hover, 
  .upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(110, 142, 251, 0.05);
  }
  
  .upload-icon {
    font-size: 2.75rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
  }
  
  .upload-area h4 {
    margin: 0 0 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
  }
  
  .text-muted {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
  }
  
  .divider {
    position: relative;
    margin: 1.75rem 0;
    color: var(--text-light);
    font-size: 0.95rem;
  }
  
  .divider:before, 
  .divider:after {
    content: "";
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--border-color);
  }
  
  .divider:before {
    left: 0;
  }
  
  .divider:after {
    right: 0;
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.75rem;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
  }
  
  .btn:active {
    transform: translateY(1px);
  }
  
  .btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(106, 142, 251, 0.3);
  }
  
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(106, 142, 251, 0.3);
  }
  
  .btn-lg {
    padding: 1.15rem 2.25rem;
    font-size: 1.15rem;
  }
  
  /* File Preview */
  .file-preview-card {
    transition: var(--transition);
    display: none;
  }
  
  .file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
  }
  
  .preview-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    background: white;
  }
  
  .preview-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
  }
  
  .preview-thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Square aspect ratio */
    overflow: hidden;
  }
  
  .preview-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f5f5f5;
  }
  
  .preview-info {
    padding: 0.85rem;
    border-top: 1px solid var(--border-color);
  }
  
  .preview-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .preview-size {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  
  .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    z-index: 2;
  }
  
  .remove-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
  }
  
  /* Options Grid */
  .options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
  }
  
  .option-item {
    margin-bottom: 1.25rem;
  }
  
  .option-item label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
  }
  
  .slider-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
  }
  
  .slider {
    flex: 1;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    transition: var(--transition);
  }
  
  .slider:hover {
    background: #d5d5d5;
  }
  
  .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
  }
  
  .slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: #5a7df5;
  }
  
  .slider-value {
    min-width: 45px;
    text-align: right;
    font-weight: 600;
    color: var(--text-dark);
  }
  
  .form-select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: white;
    font-size: 1rem;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237f8c8d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
  }
  
  .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(110, 142, 251, 0.2);
    outline: none;
  }
  
  .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  
  .form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .form-check-input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--primary-color);
    flex-shrink: 0;
  }
  
  .form-check-label {
    font-size: 1rem;
    color: var(--text-medium);
    user-select: none;
  }
  
  .option-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    line-height: 1.5;
  }
  
  .action-buttons {
    text-align: center;
    margin-top: 2rem;
  }
  
  /* Results Section */
  .results-card {
    margin-top: 3rem;
    display: none;
  }
  
  .results-summary {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
  }
  
  .result-stat {
    text-align: center;
    min-width: 120px;
  }
  
  .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1;
  }
  
  .stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
  }
  
  .results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
  }
  
  .result-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: white;
  }
  
  .result-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
  }
  
  .result-thumbnail-container {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
  }
  
  .result-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .result-details {
    flex: 1;
    min-width: 0;
  }
  
  .result-name {
    font-weight: 600;
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
    color: var(--text-dark);
  }
  
  .result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
  }
  
  .result-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  .result-stat-item i {
    font-size: 0.9em;
  }
  
  .download-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.3rem;
    transition: var(--transition);
    padding: 0.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .download-btn:hover {
    color: #4a6cf7;
    background: rgba(110, 142, 251, 0.1);
    transform: translateY(-2px);
  }
  
  .btn-success {
    background: linear-gradient(135deg, var(--secondary-color), #27ae60);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
  }
  
  .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.3);
  }
  
  /* How It Works */
  .how-it-works {
    margin-top: 4rem;
  }
  
  .steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
  }
  
  .step {
    display: flex;
    gap: 1.5rem;
  }
  
  .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 1.1rem;
  }
  
  .step-content h4 {
    margin: 0 0 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
  }
  
  .step-content p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
  }
  
  /* Loading State */
  .loading-spinner {
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Responsive Adjustments */
  @media (max-width: 992px) {
    .tool-header h1 {
      font-size: 2rem;
    }
    
    .icon-circle {
      width: 60px;
      height: 60px;
      font-size: 1.8rem;
    }
    
    .card-header {
      padding: 1.25rem;
    }
    
    .card-body {
      padding: 1.5rem;
    }
  }
  
  @media (max-width: 768px) {
    .tool-container {
      padding: 1.5rem 1rem;
    }
    
    .header-content {
      flex-direction: column;
      text-align: center;
      gap: 1.25rem;
    }
    
    .options-grid {
      grid-template-columns: 1fr;
      gap: 1.5rem;
    }
    
    .results-summary {
      gap: 2rem;
    }
    
    .results-container {
      grid-template-columns: 1fr;
    }
    
    .steps-container {
      grid-template-columns: 1fr;
      gap: 2rem;
    }
    
    .upload-area {
      padding: 2.5rem 1.5rem;
    }
  }
  
  @media (max-width: 576px) {
    .tool-header h1 {
      font-size: 1.8rem;
    }
    
    .subtitle {
      font-size: 1.05rem;
    }
    
    .file-preview {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .result-item {
      flex-direction: column;
      text-align: center;
      gap: 1rem;
    }
    
    .result-details {
      width: 100%;
    }
    
    .result-stats {
      justify-content: center;
    }
  }