    :root {
      --primary: #4f46e5;
      --primary-light: #6366f1;
      --primary-lighter: #818cf8;
      --secondary: #10b981;
      --danger: #ef4444;
      --warning: #f59e0b;
      --dark: #1e293b;
      --darker: #0f172a;
      --light: #f8fafc;
      --gray: #94a3b8;
      --gray-light: #e2e8f0;
      --gray-lighter: #f1f5f9;
      --success: #10b981;
      --info: #3b82f6;
      --white: #ffffff;
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    }

    body {
      background-color: var(--gray-lighter);
      color: var(--dark);
      min-height: 100vh;
      line-height: 1.5;
    }

    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 20px;
    }

    .headerp {
      text-align: center;
      margin-bottom: 1rem;
      padding: 1rem;
      background: white;
      border-radius: 12px;
      box-shadow: var(--shadow-sm);
    }

    .headerp h1 {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--primary);
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
    }

    .subtitle {
      font-size: 1rem;
      color: var(--gray);
      max-width: 700px;
      margin: 0 auto;
    }

    .tool-container {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.5rem;
      margin-bottom: 2rem;
    }

    @media (max-width: 768px) {
      .tool-container {
        grid-template-columns: 1fr;
      }
          .headerp h1 {
        font-size: 1rem;
    }
    }

    .panel {
      background: white;
      border-radius: 12px;
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
      overflow: hidden;
      border: 1px solid rgba(0, 0, 0, 0.03);
    }

    .panel-header {
      padding: 1rem 1.5rem;
      border-bottom: 1px solid var(--gray-light);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .panel-title {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 600;
      color: var(--darker);
    }

    .panel-actions {
      display: flex;
      gap: 0.5rem;
    }

    .btn {
      background: var(--primary);
      color: white;
      border: none;
      padding: 0.5rem 1rem;
      border-radius: 6px;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      box-shadow: var(--shadow-sm);
    }

    .btn:hover {
      background: var(--primary-lighter);
      transform: translateY(-1px);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn-sm {
      padding: 0.4rem 0.8rem;
      font-size: 0.8rem;
    }

    .btn-secondary {
      background: white;
      color: var(--primary);
      border: 1px solid var(--gray-light);
    }

    .btn-secondary:hover {
      background: rgba(79, 70, 229, 0.05);
      border-color: var(--primary-light);
    }

    .btn-danger {
      background: var(--danger);
    }

    .btn-disabled {
      opacity: 0.6;
      cursor: not-allowed;
      pointer-events: none;
    }

    .upload-section {
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .upload-option {
      border: 2px dashed var(--gray-light);
      border-radius: 10px;
      padding: 1.5rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s ease;
      position: relative;
      background-color: rgba(241, 245, 249, 0.5);
    }

    .upload-option:hover {
      border-color: var(--primary-light);
      background: rgba(79, 70, 229, 0.03);
    }

    .upload-icon {
      font-size: 2rem;
      color: var(--primary);
      margin-bottom: 0.75rem;
      opacity: 0.8;
    }

    .upload-text {
      font-size: 1rem;
      margin-bottom: 0.5rem;
      font-weight: 500;
      color: var(--dark);
    }

    .upload-subtext {
      color: var(--gray);
      font-size: 0.85rem;
    }

    #fileInput {
      display: none;
    }

    .uploaded-files {
      border-top: 1px solid var(--gray-light);
      padding: 1rem 1.5rem;
    }

    .uploaded-files-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
    }

    .uploaded-files-title {
      font-weight: 600;
      color: var(--darker);
    }

    .uploaded-files-count {
      background: var(--gray-lighter);
      color: var(--dark);
      padding: 0.2rem 0.6rem;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 600;
    }

    .uploaded-files-list {
      max-height: 300px;
      overflow-y: auto;
      padding-right: 0.5rem;
    }

    .uploaded-files-list::-webkit-scrollbar {
      width: 6px;
    }

    .uploaded-files-list::-webkit-scrollbar-track {
      background: var(--gray-lighter);
      border-radius: 3px;
    }

    .uploaded-files-list::-webkit-scrollbar-thumb {
      background: var(--gray-light);
      border-radius: 3px;
    }

    .image-card {
      display: flex;
      align-items: center;
      padding: 0.8rem;
      border-radius: 8px;
      margin-bottom: 0.5rem;
      background: var(--gray-lighter);
      transition: all 0.2s ease;
    }

    .image-card:hover {
      background: var(--gray-light);
    }

    .image-card.selected {
      background: rgba(79, 70, 229, 0.1);
      border: 1px solid var(--primary-light);
    }

    .image-preview {
      width: 50px;
      height: 50px;
      object-fit: cover;
      border-radius: 4px;
      margin-right: 1rem;
    }

    .image-info {
      flex: 1;
      min-width: 0;
    }

    .image-name {
      font-size: 0.85rem;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 0.2rem;
      color: var(--dark);
    }

    .image-stats {
      display: flex;
      font-size: 0.75rem;
      color: var(--gray);
      gap: 0.8rem;
    }

    .remove-btn {
      background: none;
      border: none;
      color: var(--danger);
      cursor: pointer;
      padding: 0.2rem;
      opacity: 0.7;
      transition: opacity 0.2s ease;
    }

    .preview-container {
      padding: 1.5rem;
      text-align: center;
      min-height: 300px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .empty-state {
      color: var(--gray);
    }

    .empty-state i {
      font-size: 3rem;
      margin-bottom: 1rem;
      opacity: 0.5;
    }

    canvas {
      max-width: 100%;
      max-height: 400px;
      display: none;
      margin-bottom: 1rem;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      border-radius: 8px;
    }

    #previewImage {
      max-width: 100%;
      max-height: 400px;
      display: none;
      margin-bottom: 1rem;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      border-radius: 8px;
    }

    .loading {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
    }

    .spinner {
      width: 40px;
      height: 40px;
      border: 4px solid var(--gray-light);
      border-top: 4px solid var(--primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 1rem;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    .progress-bar {
      width: 100%;
      height: 6px;
      background: var(--gray-light);
      border-radius: 3px;
      overflow: hidden;
      margin-top: 0.5rem;
    }

    .progress {
      height: 100%;
      background: linear-gradient(90deg, var(--primary), var(--primary-light));
      width: 0%;
      transition: width 0.3s ease;
      border-radius: 3px;
    }

    .resize-options {
      padding: 1rem 1.5rem;
      border-top: 1px solid var(--gray-light);
    }

    .size-control {
      margin-bottom: 1.5rem;
    }

    .control-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.5rem;
    }

    .control-label {
      font-size: 0.85rem;
      color: var(--dark);
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .control-value {
      font-weight: 600;
      color: var(--primary);
      background: rgba(79, 70, 229, 0.1);
      padding: 0.2rem 0.6rem;
      border-radius: 20px;
      font-size: 0.8rem;
    }

    .slider-container {
      width: 100%;
    }

    .slider {
      width: 100%;
      height: 5px;
      -webkit-appearance: none;
      background: var(--gray-light);
      border-radius: 3px;
      outline: none;
      margin-top: 0.3rem;
    }

    .slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--primary);
      cursor: pointer;
      transition: all 0.2s ease;
      border: 2px solid white;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .slider::-webkit-slider-thumb:hover {
      transform: scale(1.1);
      box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
    }

    .quality-control {
      margin-bottom: 1.5rem;
    }

    .format-control {
      margin-bottom: 1.5rem;
    }

    .format-control label {
      font-size: 0.85rem;
      margin-bottom: 0.5rem;
      color: var(--dark);
      display: block;
    }

    .format-control select {
      padding: 0.5rem;
      border: 1px solid var(--gray-light);
      border-radius: 6px;
      font-size: 0.85rem;
      width: 100%;
      max-width: 200px;
    }

    .controls {
      display: flex;
      justify-content: space-between;
      gap: 0.8rem;
      padding: 1rem 1.5rem;
      border-top: 1px solid var(--gray-light);
    }

.results-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
    display: none;
}

.results-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--darker);
}

.results-count {
    background: var(--gray-lighter);
    color: var(--dark);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.results-grid {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: var(--gray-lighter);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.result-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.result-info {
    padding: 0.8rem;
}

.result-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.result-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray);
}

.result-original-size {
    text-decoration: line-through;
    color: var(--danger);
}

.result-new-size {
    font-weight: 600;
    color: var(--success);
}

.result-savings {
    font-weight: 600;
    color: var(--success);
}

.download-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.result-card:hover .download-btn {
    opacity: 1;
}

.download-btn:hover {
    background: var(--primary-light);
    transform: scale(1.1);
}

.results-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
}

    .toast-container {
      position: fixed;
      bottom: 20px;
      right: 20px;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 0.8rem;
    }

    .toast {
      background: var(--dark);
      color: white;
      padding: 1rem;
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      display: flex;
      align-items: flex-start;
      gap: 0.8rem;
      transform: translateY(100px);
      opacity: 0;
      transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
      max-width: 350px;
      position: relative;
      overflow: hidden;
    }

    .toast::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
    }

    .toast.success::before {
      background: var(--success);
    }

    .toast.error::before {
      background: var(--danger);
    }

    .toast.warning::before {
      background: var(--warning);
    }

    .toast.info::before {
      background: var(--info);
    }

    .toast.show {
      transform: translateY(0);
      opacity: 1;
    }

    .toast i {
      font-size: 1.2rem;
      margin-top: 2px;
    }

    .toast.success i {
      color: var(--success);
    }

    .toast.error i {
      color: var(--danger);
    }

    .toast.warning i {
      color: var(--warning);
    }

    .toast.info i {
      color: var(--info);
    }

    .toast-content {
      flex: 1;
    }

    .toast-title {
      font-weight: 600;
      margin-bottom: 0.3rem;
      font-size: 0.95rem;
    }

    .toast-message {
      font-size: 0.85rem;
      opacity: 0.9;
      line-height: 1.4;
    }

    .toast-close {
      background: none;
      border: none;
      color: white;
      opacity: 0.7;
      cursor: pointer;
      transition: opacity 0.2s ease;
      padding: 0.2rem;
      display: flex;
      font-size: 0.9rem;
    }

    .toast-close:hover {
      opacity: 1;
    }

    .toast-progress {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 3px;
      background: rgba(255, 255, 255, 0.2);
      width: 100%;
    }

    .toast-progress-bar {
      height: 100%;
      background: white;
      width: 100%;
      transition: width linear;
    }

    /* Blog styles */
    .blog-container {
      background: white;
      border-radius: 12px;
      padding: 2rem;
      margin-bottom: 2rem;
    }

    .blog-container h2 {
      font-size: 1.5rem;
      margin-bottom: 1rem;
      color: var(--darker);
    }

    .blog-container h3 {
      font-size: 1.2rem;
      margin: 1.5rem 0 1rem;
      color: var(--dark);
    }

    .blog-container p {
      margin-bottom: 1rem;
      line-height: 1.6;
    }

    .blog-container ul, .blog-container ol {
      margin-bottom: 1.5rem;
      padding-left: 1.5rem;
    }

    .blog-container li {
      margin-bottom: 0.5rem;
    }

    .features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1.5rem;
      margin: 2rem 0;
    }

    .feature {
      background: var(--gray-lighter);
      border-radius: 8px;
      padding: 1.5rem;
      display: flex;
      gap: 1rem;
      align-items: flex-start;
    }

    .feature i {
      background: var(--primary);
      color: white;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 1rem;
    }

    .feature h4 {
      font-size: 1.1rem;
      margin-bottom: 0.5rem;
      color: var(--darker);
    }

    .feature p {
      font-size: 0.9rem;
      color: var(--gray);
      margin-bottom: 0;
    }

    .cta-section {
      text-align: center;
      margin: 2rem 0;
    }

    .cta-button {
      background: var(--primary);
      color: white;
      border: none;
      padding: 0.8rem 1.5rem;
      border-radius: 6px;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
    }

    .cta-button:hover {
      background: var(--primary-lighter);
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    }
