* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.subtitle {
  text-align: center;
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  margin-bottom: 40px;
  font-weight: 300;
}

.privacy-notice {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 30px;
  color: white;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.privacy-notice strong {
  color: #ffd700;
}

.code-section {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.code-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.code-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
  border-radius: 20px 20px 0 0;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c3e50;
  margin-right: 15px;
}

.language-badge {
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.html-badge { background: linear-gradient(45deg, #e34c26, #f06529); }
.css-badge { background: linear-gradient(45deg, #1572b6, #33a9dc); }
.js-badge { background: linear-gradient(45deg, #f7df1e, #ffda44); color: #333; }

.textarea-container {
  position: relative;
  margin-bottom: 20px;
}

textarea {
  width: 100%;
  height: 180px;
  padding: 20px;
  font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.6;
  border: 2px solid #e1e8ed;
  border-radius: 15px;
  resize: vertical;
  background: #f8f9fa;
  transition: all 0.3s ease;
  outline: none;
  white-space: pre;
  tab-size: 2;
}

textarea:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

textarea[readonly] {
  background: #f1f3f4;
  cursor: not-allowed;
}

.button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

button:active {
  transform: translateY(0);
}

.btn-minify {
  background: linear-gradient(45deg, #ff6b6b, #ee5a52);
  color: white;
}

.btn-beautify {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
}

.btn-copy {
  background: linear-gradient(45deg, #45b7d1, #2196f3);
  color: white;
}

.btn-clear {
  background: linear-gradient(45deg, #f39c12, #e67e22);
  color: white;
}

.btn-download {
  background: linear-gradient(45deg, #6c5ce7, #8e44ad);
  color: white;
}

.btn-minify::before,
.btn-beautify::before,
.btn-copy::before,
.btn-clear::before,
.btn-download::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-minify:hover::before,
.btn-beautify:hover::before,
.btn-copy:hover::before,
.btn-clear:hover::before,
.btn-download:hover::before {
  left: 100%;
}

.processing {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.processing::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  right: 10px;
  margin-top: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding: 15px;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.notification {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.notification.show {
  bottom: 30px;
  opacity: 1;
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .code-section {
    padding: 20px;
  }
  
  .button-container {
    flex-direction: column;
  }
  
  button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .stats {
    flex-direction: column;
    gap: 10px;
  }
}

/* Styles for new features */

/* Navigation tabs */
.tools-nav {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  gap: 15px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.nav-btn.active {
  background: white;
  color: #764ba2;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Syntax highlighting styles */
.hljs-container {
  position: relative;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
}

.hljs-container pre {
  margin: 0;
  padding: 15px;
  border-radius: 10px;
  max-height: 300px;
  overflow: auto;
}

.hljs-container code {
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.5;
}

/* Live Preview styles */
.preview-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.editor-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.preview-side {
  flex: 1;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e1e8ed;
}

.preview-frame-container {
  height: 400px;
  position: relative;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.textarea-container label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2c3e50;
}

/* Unused CSS Detector styles */
.unused-css-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.unused-css-container .textarea-container {
  flex: 1;
}

.results-container {
  margin-top: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
}

.results-container h3 {
  margin-bottom: 10px;
  color: #2c3e50;
  font-size: 18px;
}

.results-output {
  background: white;
  border-radius: 8px;
  padding: 15px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid #e1e8ed;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.unused-selector {
  color: #e74c3c;
  text-decoration: line-through;
  margin-bottom: 5px;
  display: block;
}

.used-selector {
  color: #2ecc71;
  margin-bottom: 5px;
  display: block;
}

/* Image Optimizer styles */
.image-optimizer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.upload-area {
  border: 2px dashed #667eea;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(102, 126, 234, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover {
  background: rgba(102, 126, 234, 0.1);
}

.upload-area p {
  margin-bottom: 15px;
  color: #555;
}

.upload-area.drag-over {
  background: rgba(102, 126, 234, 0.2);
  border-color: #4a67e8;
}

.btn-upload {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
}

.optimization-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-group label {
  font-weight: 500;
  color: #2c3e50;
  min-width: 80px;
}

.image-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-result-item {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.image-result-item:hover {
  transform: translateY(-5px);
}

.image-result-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.image-info {
  padding: 15px;
}

.image-info h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-stats {
  font-size: 13px;
  color: #666;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.image-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.btn-download-image {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

/* Additional button styles */
.btn-update {
  background: linear-gradient(45deg, #3498db, #2980b9);
  color: white;
}

.back-button-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 20px;
}

.btn-back {
  background: linear-gradient(45deg, #34495e, #2c3e50);
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-back::before {
  content: '←';
  font-size: 18px;
}

.btn-analyze {
  background: linear-gradient(45deg, #9b59b6, #8e44ad);
  color: white;
}

.btn-optimize {
  background: linear-gradient(45deg, #2ecc71, #27ae60);
  color: white;
}

.btn-download-all {
  background: linear-gradient(45deg, #1abc9c, #16a085);
  color: white;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Footer styles */
.footer {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  padding: 20px 0;
  margin-top: 50px;
  text-align: center;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

.footer a {
  color: #8e44ad;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 8px;
  border-radius: 4px;
}

.footer a:hover {
  color: #9b59b6;
  text-decoration: underline;
}
