/**
 * Dashboard Styles
 * Project management interface for ReaperUI Prototyper
 */

@import url('prototyper-tokens.css');

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

body {
  font-family: var(--proto-font-family);
  background: var(--proto-bg);
  color: var(--proto-text-primary);
  min-height: 100vh;
}

.dashboard {
  background: var(--proto-bg-dark);
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  border-right: 1px solid var(--proto-border);
  padding: 2.4rem 0;
  display: flex;
  flex-direction: column;
}

.dashboard-logo {
  padding: 0 2rem;
  margin-bottom: 3.2rem;
}

.dashboard-logo img {
  width: 100%;
  max-width: 160px;
  height: auto;
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 1.2rem;
}

.dashboard-nav-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.6rem;
  border-radius: var(--proto-radius-m);
  color: var(--proto-text-secondary);
  text-decoration: none;
  font-size: var(--proto-text-s);
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.dashboard-nav-item:hover:not(.active):not(.disabled) {
  background: var(--proto-bg-hover);
  color: var(--proto-text-primary);
}

.dashboard-nav-item.active {
  background: var(--proto-primary);
  color: white;
}

.dashboard-nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dashboard-nav-icon {
  width: 2rem;
  height: 2rem;
}

.coming-soon-badge {
  margin-left: auto;
  font-size: 1.1rem;
  padding: 0.2rem 0.6rem;
  background: var(--proto-bg-hover);
  border-radius: var(--proto-radius-xs);
  color: var(--proto-text-muted);
}

/* Topbar */
.dashboard-topbar {
  grid-column: 2;
  grid-row: 1;
  border-bottom: 1px solid var(--proto-border);
  padding: 1.6rem 3.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.4rem;
}

.dashboard-topbar svg {
  height: 1.8rem !important;
  width: 1.8rem !important;
}

.dashboard-search {
  flex: 1;
  max-width: 480px;
}

.dashboard-search input {
  width: 100%;
  padding: 1rem 1.6rem;
  padding-left: 4.2rem;
  background: var(--proto-bg);
  border: 1px solid var(--proto-border);
  border-radius: var(--proto-radius-m);
  color: var(--proto-text-primary);
  font-size: var(--proto-text-s);
  font-family: var(--proto-font-family);
  transition: all 0.2s;
}

.dashboard-search input:focus {
  outline: none;
  border-color: var(--proto-primary);
}

.dashboard-search {
  position: relative;
}

.dashboard-search::before {
  content: '';
  position: absolute;
  left: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.8rem;
  height: 1.8rem;
  background: var(--proto-text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn-new-project {
  padding: 1rem 2rem;
  background: var(--proto-primary);
  color: white;
  border: none;
  border-radius: var(--proto-radius-m);
  font-size: var(--proto-text-s);
  font-weight: 600;
  font-family: var(--proto-font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: all 0.2s;
}

.btn-new-project:hover {
  background: var(--proto-primary-hover);
  transform: translateY(-1px);
}

.btn-new-project i {
  width: 1.8rem;
  height: 1.8rem;
}

/* Main Content */
.dashboard-main {
  grid-column: 2;
  grid-row: 2;
  padding: 3.2rem;
  overflow-y: auto;
}

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

.project-card {
  border: 1px solid var(--proto-border);
  border-radius: var(--proto-radius-l);
  padding: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--proto-primary); /* used var(--project-color) before */
}

.project-card:hover {
  border-color: var(--proto-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

.project-card-title {
  font-size: var(--proto-text-l);
  font-weight: 600;
  color: var(--proto-text-primary);
  margin-bottom: 0.4rem;
}

.project-card-slug {
  font-size: var(--proto-text-xs);
  color: var(--proto-text-muted);
  font-family: monospace;
}

.project-card-actions {
  display: flex;
  gap: 0.8rem;
}

.project-card-btn {
  padding: 0.6rem;
  background: transparent;
  border: none;
  color: var(--proto-text-muted);
  cursor: pointer;
  border-radius: var(--proto-radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.project-card-btn:hover {
  background: var(--proto-bg-hover);
  color: var(--proto-text-primary);
}

.project-card-btn i {
  width: 1.8rem;
  height: 1.8rem;
}

.project-card-description {
  font-size: var(--proto-text-s);
  color: var(--proto-text-secondary);
  line-height: 1.6;
  flex: 1;
}

.project-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: var(--proto-text-xs);
  color: var(--proto-text-muted);
}

.project-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.project-card-meta-item i {
  width: 1.4rem;
  height: 1.4rem;
}

.project-card-footer {
  padding-top: 1.6rem;
  border-top: 1px solid var(--proto-border);
}

.btn-launch {
  width: 100%;
  padding: 1.2rem;
  background: var(--proto-primary);
  color: white;
  border: none;
  border-radius: var(--proto-radius-m);
  font-size: var(--proto-text-s);
  font-weight: 600;
  font-family: var(--proto-font-family);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  transition: all 0.2s;
}

.btn-launch:hover {
  background: var(--proto-primary-hover);
}

.btn-launch i {
  width: 1.8rem;
  height: 1.8rem;
}

/* Empty State */
.projects-empty {
  text-align: center;
  padding: 8rem 2rem;
  color: var(--proto-text-muted);
}

.projects-empty-icon {
  font-size: 6.4rem;
  margin-bottom: 2.4rem;
}

.projects-empty-title {
  font-size: var(--proto-text-xl);
  font-weight: 600;
  color: var(--proto-text-primary);
  margin-bottom: 0.8rem;
}

.projects-empty-description {
  font-size: var(--proto-text-m);
  margin-bottom: 2.4rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--proto-bg-dark);
  border-radius: var(--proto-radius-l);
  padding: 3.2rem;
  max-width: 540px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.2s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

.modal-title {
  font-size: var(--proto-text-xl);
  font-weight: 600;
  color: var(--proto-text-primary);
}

.modal-close {
  padding: 0.6rem;
  background: transparent;
  border: none;
  color: var(--proto-text-muted);
  cursor: pointer;
  border-radius: var(--proto-radius-s);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--proto-bg-hover);
  color: var(--proto-text-primary);
}

.modal-close i {
  width: 2rem;
  height: 2rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-label {
  font-size: var(--proto-text-s);
  font-weight: 600;
  color: var(--proto-text-primary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1.2rem 1.6rem;
  background: var(--proto-bg);
  border: 1px solid var(--proto-border);
  border-radius: var(--proto-radius-m);
  color: var(--proto-text-primary);
  font-size: var(--proto-text-s);
  font-family: var(--proto-font-family);
  transition: all 0.2s;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--proto-primary);
}

.form-color-input {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.color-picker {
  width: 56px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--proto-border);
  border-radius: var(--proto-radius-s);
  cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: var(--proto-radius-s);
}

.modal-footer {
  display: flex;
  gap: 1.2rem;
  justify-content: flex-end;
  margin-top: 2.4rem;
}

.btn-secondary {
  padding: 1rem 2rem;
  background: transparent;
  color: var(--proto-text-primary);
  border: 1px solid var(--proto-border);
  border-radius: var(--proto-radius-m);
  font-size: var(--proto-text-s);
  font-weight: 600;
  font-family: var(--proto-font-family);
  cursor: pointer;
  transition: all 0.2s;
  gap: 1rem;
}

.btn-secondary:hover {
  background: var(--proto-bg-hover);
}

.btn-primary {
  padding: 1rem 2rem;
  background: var(--proto-primary);
  color: white;
  border: none;
  border-radius: var(--proto-radius-m);
  font-size: var(--proto-text-s);
  font-weight: 600;
  font-family: var(--proto-font-family);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--proto-primary-hover);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success Message */
.success-message {
  background: var(--proto-bg-dark);
  border: 1px solid var(--proto-border);
  border-radius: var(--proto-radius-l);
  padding: 2.4rem;
  text-align: center;
}

.success-icon {
  width: 6.4rem;
  height: 6.4rem;
  margin: 0 auto 1.6rem;
  color: #22c55e;
}

.success-title {
  font-size: var(--proto-text-l);
  font-weight: 600;
  color: var(--proto-text-primary);
  margin-bottom: 0.8rem;
}

.success-description {
  font-size: var(--proto-text-s);
  color: var(--proto-text-secondary);
  margin-bottom: 2.4rem;
}

.success-actions {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}

/* Responsive */
@media (max-width: 968px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    grid-column: 1;
    grid-row: 1;
    border-right: none;
    border-bottom: 1px solid var(--proto-border);
  }

  .dashboard-topbar {
    grid-column: 1;
    grid-row: 2;
  }

  .dashboard-main {
    grid-column: 1;
    grid-row: 3;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}
