/* ============================================
   KANBAN SISZAPP - JIRA CLOUD STYLE
   Interface Corporativa Profissional
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================
   ROOT VARIABLES - Jira Color Palette
   ============================================ */
:root {
  /* Cores principais Jira */
  --jira-blue-primary: #0052CC;
  --jira-blue-dark: #0747A6;
  --jira-blue-light: #4C9AFF;
  --jira-blue-subtle: #DEEBFF;
  
  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F4F5F7;
  --bg-tertiary: #FAFBFC;
  --bg-sidebar: #0747A6;
  --bg-hover: #EBECF0;
  
  /* Borders & Separators */
  --border-color: #DFE1E6;
  --border-hover: #C1C7D0;
  
  /* Text */
  --text-primary: #172B4D;
  --text-secondary: #5E6C84;
  --text-subtle: #6B778C;
  --text-inverse: #FFFFFF;
  
  /* Shadows */
  --shadow-card: 0 1px 2px rgba(9, 30, 66, 0.25);
  --shadow-hover: 0 4px 8px rgba(9, 30, 66, 0.15);
  --shadow-elevated: 0 8px 16px rgba(9, 30, 66, 0.2);
  
  /* Status Colors */
  --status-todo: #DFE1E6;
  --status-progress: #0052CC;
  --status-done: #00875A;
  --status-blocked: #DE350B;
  
  /* Priority Colors */
  --priority-low: #6B778C;
  --priority-medium: #0065FF;
  --priority-high: #FF5630;
  --priority-urgent: #DE350B;
}

/* Dark Mode Variables */
.dark {
  --bg-primary: #1D2125;
  --bg-secondary: #22272B;
  --bg-tertiary: #282E33;
  --bg-sidebar: #0C1824;
  --bg-hover: #2C333A;
  
  --border-color: #38424B;
  --border-hover: #454F59;
  
  --text-primary: #B6C2CF;
  --text-secondary: #8C9BAB;
  --text-subtle: #738496;
  --text-inverse: #1D2125;
  
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* ============================================
   BASE STYLES
   ============================================ */
[x-cloak] { display: none !important; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
}

.text-mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* ============================================
   LAYOUT STRUCTURE
   ============================================ */

/* Topbar Jira Style */
.jira-topbar {
  height: 56px;
  background: var(--jira-blue-dark);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.jira-topbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 20px;
  margin-right: 24px;
}

.jira-topbar-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.jira-topbar-item {
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jira-topbar-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-inverse);
}

.jira-topbar-item.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-inverse);
}

/* Sidebar Jira Style */
.jira-sidebar {
  width: 240px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  overflow-y: auto;
  flex-shrink: 0;
}

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

.jira-sidebar-section {
  padding: 16px 8px;
  border-bottom: 1px solid var(--border-color);
}

.jira-sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  padding: 0 8px 8px;
}

.jira-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.jira-sidebar-item:hover {
  background: var(--bg-hover);
}

.jira-sidebar-item.active {
  background: var(--jira-blue-subtle);
  color: var(--jira-blue-primary);
  font-weight: 600;
}

.jira-sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--jira-blue-primary);
  border-radius: 0 3px 3px 0;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.jira-main {
  flex: 1;
  background: var(--bg-secondary);
  padding: 24px;
  overflow-y: auto;
  height: calc(100vh - 56px);
}

.jira-page-header {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.jira-page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.jira-page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================
   KANBAN BOARD STYLES
   ============================================ */
.jira-board-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.jira-column {
  background: var(--bg-tertiary);
  border-radius: 3px;
  min-width: 280px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.jira-column-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  border-radius: 3px 3px 0 0;
}

.jira-column-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.jira-column-count {
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-subtle);
}

.jira-column-content {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

/* ============================================
   TASK CARDS - Jira Style
   ============================================ */
.jira-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-card);
}

.jira-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.jira-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.jira-card-id {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-subtle);
  font-family: 'JetBrains Mono', monospace;
}

.jira-card-priority {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.jira-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jira-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.jira-card-label {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.jira-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.jira-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--jira-blue-primary);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: 600;
}

.jira-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-subtle);
}

/* ============================================
   BUTTONS - Jira Style
   ============================================ */
.jira-btn {
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.jira-btn-primary {
  background: var(--jira-blue-primary);
  color: var(--text-inverse);
}

.jira-btn-primary:hover {
  background: var(--jira-blue-dark);
}

.jira-btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.jira-btn-secondary:hover {
  background: var(--border-color);
}

.jira-btn-subtle {
  background: transparent;
  color: var(--text-secondary);
}

.jira-btn-subtle:hover {
  background: var(--bg-hover);
}

.jira-btn-icon {
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   INPUTS & FORMS - Jira Style
   ============================================ */
.jira-input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.jira-input:hover {
  border-color: var(--border-hover);
}

.jira-input:focus {
  outline: none;
  border-color: var(--jira-blue-primary);
  box-shadow: 0 0 0 1px var(--jira-blue-primary);
}

.jira-select {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235E6C84' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.jira-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.jira-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* ============================================
   MODALS - Jira Style
   ============================================ */
.jira-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 66, 0.54);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.jira-modal {
  background: var(--bg-primary);
  border-radius: 3px;
  box-shadow: var(--shadow-elevated);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

.jira-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.jira-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.jira-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================
   PRIORITY INDICATORS
   ============================================ */
.priority-urgent {
  background: var(--priority-urgent);
  color: white;
}

.priority-high {
  background: var(--priority-high);
  color: white;
}

.priority-medium {
  background: var(--priority-medium);
  color: white;
}

.priority-low {
  background: var(--priority-low);
  color: white;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-todo {
  background: var(--status-todo);
  color: var(--text-primary);
}

.status-progress {
  background: var(--jira-blue-subtle);
  color: var(--jira-blue-dark);
}

.status-done {
  background: #E3FCEF;
  color: var(--status-done);
}

/* ============================================
   UTILITIES
   ============================================ */
.jira-divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

.jira-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-subtle);
}

.jira-avatar-group {
  display: flex;
  align-items: center;
}

.jira-avatar-group .jira-card-avatar {
  margin-left: -8px;
  border: 2px solid var(--bg-primary);
}

.jira-avatar-group .jira-card-avatar:first-child {
  margin-left: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes jira-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.jira-fade-in {
  animation: jira-fade-in 0.2s ease-out;
}

/* ============================================
   SCROLLBAR - Jira Style
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ============================================
   DRAG & DROP
   ============================================ */
.sortable-ghost {
  opacity: 0.4;
  background: var(--jira-blue-subtle);
  border: 2px dashed var(--jira-blue-primary);
}

.sortable-drag {
  box-shadow: var(--shadow-elevated);
  transform: rotate(2deg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .jira-sidebar {
    position: fixed;
    left: -240px;
    z-index: 90;
    transition: left 0.3s ease;
  }
  
  .jira-sidebar.mobile-open {
    left: 0;
  }
}

@media (max-width: 768px) {
  .jira-topbar {
    padding: 0 12px;
  }
  
  .jira-main {
    padding: 16px;
  }
  
  .jira-column {
    min-width: 260px;
    max-width: 260px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .jira-topbar,
  .jira-sidebar,
  .jira-btn {
    display: none !important;
  }
  
  .jira-main {
    padding: 0;
  }
  
  .jira-card {
    break-inside: avoid;
  }
}
