/* AI Web Generator - Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
  background: linear-gradient(135deg, #1e2329 0%, #2d3138 100%);
  min-height: 100vh;
}

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

/* Top Bar */
.top-bar {
  background: rgba(30, 35, 41, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
}

.top-bar a {
  color: #1CCC5B;
  text-decoration: none;
}

.top-bar a:hover {
  text-decoration: underline;
}

/* Pills */
.pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 40px 0 30px;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  color: #e0e0e0;
  backdrop-filter: blur(10px);
}

.pill:hover {
  background: rgba(28, 204, 91, 0.1);
  border-color: #1CCC5B;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(28, 204, 91, 0.2);
}

.pill.active {
  background: #1CCC5B;
  color: #0a0a0a;
  border-color: #1CCC5B;
  font-weight: 500;
}

/* Main Content Area */
.main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-top: 30px;
}

.prompt-section {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.context-field {
  margin-bottom: 15px;
  display: none;
}

.context-field.visible {
  display: block;
}

.context-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #b0b0b0;
  font-size: 14px;
}

.context-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(28, 204, 91, 0.3);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: #e0e0e0;
  transition: all 0.3s;
}

.context-field input:focus {
  outline: none;
  border-color: #1CCC5B;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(28, 204, 91, 0.1);
}

textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 1px solid rgba(28, 204, 91, 0.3);
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  background: rgba(255, 255, 255, 0.03);
  color: #e0e0e0;
  transition: all 0.3s;
}

textarea:focus {
  outline: none;
  border-color: #1CCC5B;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(28, 204, 91, 0.1);
}

/* Tips Section */
.tips-section {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.tips-section h3 {
  margin-bottom: 15px;
  color: #e0e0e0;
  font-size: 18px;
  font-weight: 500;
}

.tips-section ul {
  list-style: none;
  padding-left: 0;
}

.tips-section li {
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
}

.tips-section li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: #1CCC5B;
}

.add-reference-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background: rgba(28, 204, 91, 0.2);
  color: #1CCC5B;
  border: 1px solid #1CCC5B;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}

.add-reference-btn:hover {
  background: #1CCC5B;
  color: #0a0a0a;
  transform: translateY(-1px);
}

/* Buttons */
.btn {
  padding: 14px 32px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: #1CCC5B;
  color: #0a0a0a;
}

.btn-primary:hover {
  background: #16a348;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(28, 204, 91, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.btn-success {
  background: #1CCC5B;
  color: #0a0a0a;
}

.btn-success:hover {
  background: #16a348;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(28, 204, 91, 0.3);
}

.btn-large {
  padding: 18px 50px;
  font-size: 18px;
  margin-top: 30px;
  display: block;
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 50px;
  font-weight: 600;
}

/* Editor Layout */
.editor-container {
  display: grid;
  grid-template-columns: 350px 1fr;
  height: calc(100vh - 60px);
  background: linear-gradient(135deg, #1e2329 0%, #2d3138 100%);
}

/* Chatbot Panel */
.chatbot-panel {
  background: rgba(30, 35, 41, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.chat-input-wrapper {
  background: rgba(30, 35, 41, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  backdrop-filter: blur(15px);
  position: sticky;
  bottom: 0;
}

.chat-messages {
  flex: 1;
  margin-bottom: 20px;
}

.chat-message {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 8px;
}

.chat-message.user {
  background: rgba(28, 204, 91, 0.1);
  border: 1px solid rgba(28, 204, 91, 0.2);
  margin-left: 20px;
}

.chat-message.bot {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-right: 20px;
}

.chat-message .label {
  font-size: 12px;
  color: #1CCC5B;
  margin-bottom: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-input {
  display: flex;
  gap: 0;
  align-items: flex-end;
  background: rgba(30, 35, 41, 0.8);
  border: 1px solid #1CCC5B;
  border-radius: 25px;
  padding: 8px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.chat-input:focus-within {
  border-color: #1CCC5B;
  box-shadow: 0 0 20px rgba(28, 204, 91, 0.2);
}

.chat-input textarea {
  flex: 1;
  min-height: 24px;
  max-height: 120px;
  resize: none;
  background: transparent;
  border: none;
  outline: none;
  color: #e0e0e0;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.chat-input textarea::placeholder {
  color: #666;
  font-style: italic;
}

.chat-input button {
  background: transparent;
  border: none;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.chat-input button svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 12px rgba(0, 255, 103, 0.3));
  transition: all 0.2s ease;
}

.chat-input button:hover svg {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 16px rgba(0, 255, 103, 0.4));
}

.chat-input button:active svg {
  transform: scale(0.95);
}

/* Preview Panel */
.preview-panel {
  padding: 20px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Device Switcher */
.device-switcher-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 20px;
  background: rgba(30, 35, 41, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(15px);
}

.device-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-label {
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 500;
  margin-right: 8px;
}

.device-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
}

.device-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #b0b0b0;
  transition: all 0.2s;
  font-weight: 500;
}

.device-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #e0e0e0;
}

.device-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.3);
}

.device-btn svg {
  width: 18px;
  height: 18px;
}

.divider {
  width: 1px;
  height: 24px;
  background: #dee2e6;
  margin: 0 8px;
}

/* Save button */
.save-btn {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e0e0e0 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px;
  font-weight: 500;
}

.save-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Editable content */
.editable {
  outline: none;
  transition: all 0.2s;
  position: relative;
}

.editable:hover {
  background: rgba(0, 123, 255, 0.05);
  border-radius: 4px;
  cursor: text;
}

.editable:focus {
  background: rgba(0, 123, 255, 0.08);
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* Add visual hint for editable areas */
.editable::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px dashed transparent;
  border-radius: 4px;
  pointer-events: none;
  transition: border-color 0.2s;
}

.editable:hover::after {
  border-color: rgba(0, 123, 255, 0.3);
}

.preview-frame {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 30px;
  min-height: 500px;
  transition: all 0.3s ease;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  backdrop-filter: blur(10px);
}

.preview-frame.mobile-view {
  max-width: 375px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border-radius: 20px;
  padding: 20px 15px;
}

/* Sample Page Content */
.sample-page {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.preview-frame.mobile-view .sample-page {
  max-width: 100%;
}

.sample-page h1 {
  color: #333;
  margin-bottom: 20px;
}

.preview-frame.mobile-view .sample-page h1 {
  font-size: 24px;
}

.sample-page .services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.preview-frame.mobile-view .sample-page .services {
  grid-template-columns: 1fr;
  gap: 15px;
}

.sample-page .service-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.sample-page .service-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(28, 204, 91, 0.3);
  transform: translateY(-2px);
}

/* Progress Animation */
.progress-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  flex-direction: column;
}

.progress-bar-wrapper {
  width: 80%;
  max-width: 500px;
  height: 30px;
  background: #e9ecef;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  width: 0%;
  animation: progress 20s linear forwards;
  transition: width 0.3s;
}

@keyframes progress {
  to {
    width: 100%;
  }
}

.progress-text {
  color: #666;
  font-size: 16px;
  margin-top: 20px;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: linear-gradient(135deg, #2d3138 0%, #1e2329 100%);
  padding: 32px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-header h2 {
  color: #e0e0e0;
  font-weight: 500;
}

.modal-close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #1CCC5B;
}

.modal-body {
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #b0b0b0;
  font-size: 14px;
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(28, 204, 91, 0.3);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: #e0e0e0;
  transition: all 0.3s;
}

.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: #1CCC5B;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(28, 204, 91, 0.1);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .editor-container {
    grid-template-columns: 1fr;
  }
  
  .chatbot-panel {
    display: none;
  }
  
  .pills-container {
    padding: 0 10px;
  }
}