/* Stoik Content OS - Styling System */

:root {
  --font-primary: 'Inter', sans-serif;
  --font-heading: 'Montserrat', sans-serif;

  /* Color Palette */
  --bg-app: #0d0e12;
  --bg-sidebar: #13151a;
  --bg-panel: #1b1e25;
  --bg-card: #232731;
  --bg-card-hover: #2b313d;
  
  --border-color: rgba(255, 255, 255, 0.07);
  --border-focus: #d4af37;
  
  /* Text colors */
  --text-main: #f0f2f5;
  --text-muted: #8e99a8;
  --text-inverse: #0d0e12;

  /* Brand Accents */
  --accent-gold: #d4af37;
  --accent-gold-rgb: 212, 175, 55;
  --accent-gold-glow: rgba(212, 175, 55, 0.15);

  /* Status Colors */
  --status-brief: #f5a623;
  --status-brief-bg: rgba(245, 166, 35, 0.15);
  
  --status-designing: #4a90e2;
  --status-designing-bg: rgba(74, 144, 226, 0.15);
  
  --status-review: #bd10e0;
  --status-review-bg: rgba(189, 16, 224, 0.15);
  
  --status-approved: #2ecc71;
  --status-approved-bg: rgba(46, 204, 113, 0.15);

  /* Box Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --glow-gold: 0 0 15px rgba(212, 175, 55, 0.2);

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout Framework */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--text-main);
}

.logo-text span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  overflow-y: auto;
}

.nav-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-left: 8px;
  text-transform: uppercase;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-weight: 500;
  font-size: 14px;
}

.category-item i {
  width: 18px;
  height: 18px;
}

.category-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
}

.category-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.category-item.active {
  background-color: var(--accent-gold-glow);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: var(--glow-gold);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--accent-gold);
  color: var(--text-inverse);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.user-info h4 {
  font-size: 14px;
  font-weight: 600;
}

.user-info span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Panel Layout */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-app);
}

.top-navbar {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(13, 14, 18, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.navbar-left h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.navbar-left p {
  font-size: 13px;
  color: var(--text-muted);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.view-switch {
  display: flex;
  background: var(--bg-panel);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.switch-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.switch-btn.active {
  background-color: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.switch-btn i {
  width: 14px;
  height: 14px;
}

/* Viewports */
.workspace-viewport {
  flex: 1;
  padding: 32px;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
}

/* Kanban / Pipeline View */
.pipeline-container {
  display: flex;
  gap: 24px;
  height: 100%;
  width: 100%;
}

.pipeline-column {
  width: 320px;
  background-color: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

.column-header {
  padding: 20px 20px 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

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

.status-indicator.brief { background-color: var(--status-brief); }
.status-indicator.designing { background-color: var(--status-designing); }
.status-indicator.review { background-color: var(--status-review); }
.status-indicator.approved { background-color: var(--status-approved); }

.column-header h3 {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-heading);
  flex: 1;
}

.card-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 20px;
}

.column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Content Card */
.content-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.content-card:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-gold);
}

.canva-indicator {
  font-size: 10px;
  background-color: rgba(0, 196, 184, 0.15);
  color: #00c4b8;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.content-card h4 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.card-preview-mini {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.3);
  position: relative;
}

.card-preview-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-preview-blank {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  gap: 6px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  margin-top: 4px;
}

.comment-indicator {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment-indicator i {
  width: 14px;
  height: 14px;
}

.card-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #34495e;
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Gallery View */
.grid-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  padding-bottom: 40px;
}

/* Buttons */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background-color: var(--accent-gold);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background-color: #e6c863;
  box-shadow: var(--glow-gold);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-success {
  background-color: var(--status-approved);
  color: #0d0e12;
}
.btn-success:hover {
  background-color: #27ae60;
}

/* Modal / Dialog Base styling */
.modal-dialog {
  border: none;
  background: transparent;
  margin: auto;
  padding: 0;
  max-width: 900px;
  width: calc(100vw - 48px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-dialog::backdrop {
  background-color: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(8px);
}

.dialog-content {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.dialog-content.sm {
  max-width: 500px;
}

.dialog-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.dialog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-category-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold);
  background-color: var(--accent-gold-glow);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.dialog-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.dialog-status-badge.brief { background-color: var(--status-brief-bg); color: var(--status-brief); }
.dialog-status-badge.designing { background-color: var(--status-designing-bg); color: var(--status-designing); }
.dialog-status-badge.review { background-color: var(--status-review-bg); color: var(--status-review); }
.dialog-status-badge.approved { background-color: var(--status-approved-bg); color: var(--status-approved); }

.dialog-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.dialog-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

/* Dialog Body Grid */
.dialog-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 500px;
}

.dialog-left-pane {
  padding: 32px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  max-height: 70vh;
}

.dialog-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
}

/* Canva Pane */
.canva-integration-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canva-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.placeholder-icon {
  font-size: 40px;
}

.canva-live-frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canva-live-frame img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.canva-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.canva-tag {
  font-size: 11px;
  font-weight: 600;
  color: #00c4b8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.canva-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #00c4b8;
  box-shadow: 0 0 8px #00c4b8;
}

.dialog-brief-description h3 {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.dialog-brief-description p {
  line-height: 1.6;
  font-size: 14px;
}

/* Right Pane - Collab & Actions */
.dialog-right-pane {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: 70vh;
}

.status-updater h3,
.collab-feed-container h3 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* Forms */
.form-select,
.new-item-form-body select,
.new-item-form-body input,
.new-item-form-body textarea {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.form-select:focus,
.new-item-form-body select:focus,
.new-item-form-body input:focus,
.new-item-form-body textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Collaboration Comments Feed */
.collab-feed-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.comments-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  max-height: 180px;
}

.comment-bubble {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-bubble.stoik {
  border-left: 3px solid var(--accent-gold);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.comment-author {
  font-weight: 700;
  color: var(--accent-gold);
}

.comment-author.designer {
  color: var(--text-main);
}

.comment-time {
  color: var(--text-muted);
}

.comment-text {
  font-size: 13px;
  line-height: 1.4;
}

.comment-input-area textarea {
  resize: none;
  height: 60px;
  margin-bottom: 8px;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
}

/* Dialog Footer */
.dialog-actions-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Form Styles for Create Item Dialog */
.new-item-form-body {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 10px;
}

/* Split Workspace Layout */
.split-workspace-viewport {
  flex: 1;
  display: flex;
  height: calc(100vh - 90px);
  overflow: hidden;
  background-color: var(--bg-app);
}

.workspace-editor-pane {
  flex: 1;
  height: 100%;
  border-right: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.2);
}

.canva-live-workspace {
  width: 100%;
  height: 100%;
}

.canva-live-workspace iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #000;
}

.workspace-collab-pane {
  width: 340px;
  height: 100%;
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 24px;
  gap: 20px;
  border-left: 1px solid var(--border-color);
}

.collab-pane-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.collaborator-bubbles {
  display: flex;
  gap: 8px;
}

.collab-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workspace-collab-pane .comments-list {
  max-height: none;
  flex: 1;
  margin-bottom: 0;
}

.workspace-collab-pane .collab-feed-container {
  flex: 1;
  min-height: 0;
}

.collab-pane-actions-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* Helpers */
.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .split-workspace-viewport {
    flex-direction: column;
    overflow-y: auto;
  }
  .workspace-editor-pane {
    height: 50vh;
  }
  .workspace-collab-pane {
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
}
