/* Cluvra App Styles - Premium Cloud Aesthetic */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: var(--transition);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-header .logo svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.close-sidebar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  transition: var(--transition);
}

.close-sidebar:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.05));
  color: var(--accent2);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-item.active svg {
  color: var(--accent);
  opacity: 1;
}

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  margin-left: 0;
  transition: var(--transition);
  background: transparent;
}

@media (min-width: 992px) {
  .sidebar {
    transform: translateX(0);
    background: rgba(15, 15, 25, 0.7);
  }
  .main-content {
    margin-left: var(--sidebar-w);
  }
  .menu-toggle {
    display: none !important;
  }
}

.topbar {
  height: 72px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 80;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
}

.page-title {
  flex: 1;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  gap: 1rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.view-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.view-content.hidden, .hidden {
  display: none !important;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  transform: translateY(-4px);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 28px;
  height: 28px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text2);
  margin-top: 0.25rem;
}

/* Section */
.section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-btn {
  color: var(--accent2);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.text-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Project Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project-header h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.active { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-badge.pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-badge.failed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.project-desc {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text3);
}

.project-meta a {
  color: var(--accent2);
  font-weight: 500;
}

.project-card.add-new {
  border: 2px dashed var(--border);
  background: transparent;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.project-card.add-new svg {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5rem;
}

/* Deploy Form */
.deploy-form {
  max-width: 800px;
  margin: 0 auto;
}

.form-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.form-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 0.65rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.85rem 1.15rem;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.source-options {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.source-option {
  flex: 1;
  padding: 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.source-option svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.source-option.active svg {
  opacity: 1;
}

/* File Explorer & Editor */
.file-explorer-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1rem;
  height: 500px;
  margin-top: 1rem;
}

.file-tree {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text2);
  transition: var(--transition);
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.file-item.active {
  background: var(--accent);
  color: #fff;
}

.editor-area {
  display: flex;
  flex-direction: column;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.editor-header span {
  font-size: 0.8rem;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}

#codeEditor {
  flex: 1;
  background: transparent;
  color: #d1d5db;
  border: none;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.editor-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 0.9rem;
}

.source-option span {
  font-weight: 600;
  font-size: 1rem;
}

.source-option.active {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 0 0 2px var(--accent);
}

.source-option {
  padding: 1.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.source-option:hover {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.08);
}

.source-option.active {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.1);
}

/* Empty State */
.empty-state {
  padding: 5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text2);
  font-weight: 500;
}

/* Domain List */
.domain-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.domain-name {
  font-weight: 700;
  font-size: 1rem;
}

.domain-status {
  margin-left: 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
}

.domain-status.verified { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.domain-status.pending { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Settings */
.settings-section {
  border-radius: var(--radius-lg);
}

.api-key-display {
  background: #000;
  border: 1px solid var(--border);
  padding: 1.25rem;
}

.api-key-display code {
  font-size: 1rem;
}

/* Project Settings Layout */
.settings-layout {
  display: flex;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  height: calc(100vh - 120px);
}

.settings-sidebar {
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  height: fit-content;
}

.settings-nav-item {
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  color: var(--text2);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.settings-nav-item.active {
  background: var(--accent);
  color: #fff;
}

.settings-nav-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.settings-main {
  flex: 1;
  overflow-y: auto;
  padding-right: 1rem;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.form-card {
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
}

.form-card h3 {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  min-width: 180px;
  padding: 0.5rem;
  border-radius: var(--radius);
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.dropdown-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.dropdown-menu button svg {
  width: 16px;
  height: 16px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* Utils */
.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text2);
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.status-badge.suspended {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

@media (max-width: 991px) {
  .settings-layout {
    flex-direction: column;
    height: auto;
  }
  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
}