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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #db7d12 0%, #db7d12 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #040366 0%, #7fba00 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 300;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}



/* Header with logo layout */
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-logo {
  height: 60px;
  width: auto;
  flex-shrink: 0;
}

.header-text {
  text-align: center;
}

.header-text h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 300;
}

.header-text p {
  margin: 5px 0 0 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.input-section {
  padding: 30px;
  border-bottom: 1px solid #eee;
}

.input-section label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

.input-textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Courier New", monospace;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.input-textarea:focus {
  outline: none;
  border-color: #040366;
  box-shadow: 0 0 0 3px rgba(4, 3, 102, 0.1);
}

.button-group {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.btn-primary {
  background: linear-gradient(135deg, #040366 0%, #7fba00 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(4, 3, 102, 0.3);
}

.btn-secondary {
  background: #db7d12;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #d35400;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 126, 34, 0.3);
}

.btn-tertiary {
  background: #3498db;
  color: white;
}

.btn-tertiary:hover:not(:disabled) {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.status-section {
  padding: 20px 30px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-message {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  max-width: 100%;
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.loading-spinner {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #666;
  font-weight: 500;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #040366;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.output-section {
  padding: 30px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.output-header h3 {
  color: #333;
  font-size: 1.3rem;
}

.html-length {
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
}

#htmlOutput {
  width: 100%;
  height: 400px;
  padding: 20px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  background: #f8f9fa;
  resize: vertical;
}

#htmlOutput:focus {
  outline: none;
  border-color: #040366;
  box-shadow: 0 0 0 3px rgba(4, 3, 102, 0.1);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.modal-header h3 {
  color: #333;
  font-size: 1.3rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #e9ecef;
  color: #333;
}

.modal-body {
  padding: 0;
}

#previewFrame {
  border: none;
  display: block;
}

/* Password Prompt Styles */
.password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.password-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  margin: 20px;
}

.password-header {
  text-align: center;
  margin-bottom: 30px;
}

.password-header h2 {
  color: #040366;
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 300;
}

.password-header p {
  color: #666;
  font-size: 1rem;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.password-form input {
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.password-form input:focus {
  outline: none;
  border-color: #040366;
  box-shadow: 0 0 0 3px rgba(4, 3, 102, 0.1);
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
}

/* Header with logout button */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Mobile Styles */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  header {
    padding: 20px;
  }

  .header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .header-logo {
    height: 50px;
    width: auto;
  }

  .header-text h1 {
    font-size: 1.8rem;
  }

  .btn-logout {
    margin-top: auto;
    align-self: center;
  }
}
