/* style.css - Premium Glassmorphic Stylesheet for FlowStudio Platform */
:root {
  --bg-base: #060b18;
  --bg-surface: rgba(14, 22, 45, 0.6);
  --bg-surface-hover: rgba(22, 33, 67, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(0, 212, 255, 0.3);
  
  --primary: #1a6cf6;
  --primary-glow: rgba(26, 108, 246, 0.4);
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.4);
  
  --text-main: #e8edf5;
  --text-muted: #6b7fa3;
  --text-dark: #2a3550;
  
  --success: #2ed573;
  --success-glow: rgba(46, 213, 115, 0.2);
  --danger: #ff4757;
  --danger-glow: rgba(255, 71, 87, 0.2);
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(26, 108, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 40%);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.5px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #fff;
}

/* App Header & Branding */
header {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Connection Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.status-badge.connected {
  background: rgba(46, 213, 115, 0.08);
  border-color: rgba(46, 213, 115, 0.2);
  color: var(--success);
}

.status-badge.disconnected {
  background: rgba(255, 71, 87, 0.08);
  border-color: rgba(255, 71, 87, 0.2);
  color: var(--danger);
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-badge.connected .dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.8s infinite;
}

.status-badge.disconnected .dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

/* Main Container Layout */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Cards & Glass Containers */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Forms (Login/Register) */
.auth-container {
  max-width: 440px;
  margin: 40px auto;
}

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

.auth-header h2 {
  font-size: 28px;
  color: #fff;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
}

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

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(2, 6, 16, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
}

.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* User Card Panel */
.user-profile-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.user-identity h3 {
  font-size: 24px;
  color: white;
}

.user-identity p {
  color: var(--text-muted);
  font-size: 14px;
}

.credit-balance-pill {
  background: linear-gradient(135deg, rgba(26, 108, 246, 0.15), rgba(0, 212, 255, 0.15));
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 10px 20px;
  border-radius: 14px;
  text-align: right;
}

.credit-balance-pill span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.5px;
  font-weight: 700;
}

.credit-balance-pill strong {
  font-size: 22px;
  color: white;
  font-family: var(--font-display);
}

/* Tools Feed */
.section-title {
  font-size: 20px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 992px) {
  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-glow);
  box-shadow: 0 10px 25px rgba(0, 212, 255, 0.05);
  background: var(--bg-surface-hover);
}

.tool-info h4 {
  font-size: 18px;
  color: white;
  margin-bottom: 6px;
}

.tool-info p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
  min-height: 42px;
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.cost-tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0f4dc7);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3d85f7, var(--primary));
  box-shadow: 0 8px 24px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #028fae);
  color: #060b18;
}

.btn-accent:hover {
  background: linear-gradient(135deg, #53e4ff, var(--accent));
  box-shadow: 0 8px 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Tab controls */
.tabs-header {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab-btn.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

/* Notification Popup */
.alert-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 380px;
  width: calc(100% - 48px);
  background: rgba(14, 22, 45, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-popup.show {
  transform: translateY(0);
}

.alert-popup.success {
  border-left: 4px solid var(--success);
}

.alert-popup.error {
  border-left: 4px solid var(--danger);
}

.alert-popup.info {
  border-left: 4px solid var(--accent);
}

.alert-content h5 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.alert-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Admin/Manager Section */
.admin-card {
  background: rgba(14, 22, 45, 0.4);
  border: 1px solid var(--border-color);
}

.admin-card h3 {
  margin-bottom: 18px;
  color: white;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 992px) {
  .admin-grid {
    grid-template-columns: 1fr 2fr;
  }
}

.admin-tool-select {
  border-right: 1px solid var(--border-color);
  padding-right: 20px;
}

.admin-tool-select ul {
  list-style: none;
}

.admin-tool-select li {
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-weight: 500;
}

.admin-tool-select li:hover {
  background: rgba(255, 255, 255, 0.03);
  color: white;
}

.admin-tool-select li.active {
  background: rgba(26, 108, 246, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.15);
}

.code-textarea {
  font-family: monospace;
  font-size: 13px !important;
  line-height: 1.5;
  background: rgba(2, 6, 16, 0.8) !important;
  color: var(--accent) !important;
  resize: vertical;
}

/* Footer styling */
footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-dark);
  font-size: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

/* Animations and Utilities */
.hidden {
  display: none !important;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
