/* Modern Portfolio Dashboard CSS - Inspired by Job Portal Design */

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

:root {
  /* Primary Purple Theme */
  --primary-purple: #6366f1;
  --primary-purple-light: #818cf8;
  --primary-purple-dark: #4f46e5;
  --primary-purple-bg: linear-gradient(135deg, #667eea 0%, #4b5ea2 100%);

  /* Secondary Colors */
  --blue: #3b82f6;
  --green: #10b981;
  --orange: #f59e0b;
  --red: #ef4444;

  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Sidebar */
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition: all 0.2s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
}

/* App Layout */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary-purple-bg);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
  box-shadow: var(--shadow-xl);
}

.sidebar__header {
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.logo-icon i {
  width: 24px;
  height: 24px;
  color: var(--white);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

/* Navigation */
.sidebar__nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
  margin: 0.125rem 1rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  position: relative;
}

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

.nav-item--active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.nav-item--active::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--white);
  border-radius: 2px;
}

.nav-item i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar__footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--white);
}

.user-avatar {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.user-avatar i {
  width: 24px;
  height: 24px;
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Stats Circle in Sidebar */
.sidebar__stats {
  display: flex;
  justify-content: center;
}

.stat-circle {
  width: 80px;
  height: 80px;
  background: conic-gradient(
    var(--white) 0deg 306deg,
    rgba(255, 255, 255, 0.2) 306deg 360deg
  );
  border-radius: 50%;
  padding: 4px;
  position: relative;
}

.stat-circle__content {
  width: 100%;
  height: 100%;
  background: var(--primary-purple);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.stat-percentage {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.625rem;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition-slow);
}

/* Header */
.main-header {
  background: var(--white);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: var(--gray-100);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.header__center {
  flex: 1;
  max-width: 400px;
  margin: 0 2rem;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar i {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: var(--gray-400);
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  font-size: 0.875rem;
  transition: var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary-purple);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.header__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-btn {
  position: relative;
  background: none;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.notification-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  min-width: 18px;
  text-align: center;
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* Sections */
.section {
  display: none;
}

.section--active {
  display: block;
}

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.stat-card--purple::before {
  background: var(--primary-purple);
}

.stat-card--blue::before {
  background: var(--blue);
}

.stat-card--green::before {
  background: var(--green);
}

.stat-card--orange::before {
  background: var(--orange);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.stat-card--purple .stat-card__icon {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-purple);
}

.stat-card--blue .stat-card__icon {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
}

.stat-card--green .stat-card__icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.stat-card--orange .stat-card__icon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--orange);
}

.stat-card__icon i {
  width: 24px;
  height: 24px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card__header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card__header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  flex: 1;
}

.card__header p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.card__actions {
  display: flex;
  gap: 0.5rem;
}

.card__body {
  padding: 1.5rem;
}

.card__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* Chart Legend */
.chart-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot--blue {
  background: var(--blue);
}

.legend-dot--green {
  background: var(--green);
}

.legend-dot--red {
  background: var(--red);
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon--success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.activity-icon--info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
}

.activity-icon--warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--orange);
}

.activity-icon i {
  width: 16px;
  height: 16px;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 500;
  color: var(--gray-900);
  font-size: 0.875rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.upload-zone:hover {
  border-color: var(--primary-purple);
  background: rgba(99, 102, 241, 0.02);
}

.upload-zone--dragover {
  border-color: var(--primary-purple);
  background: rgba(99, 102, 241, 0.05);
}

.upload-zone__content i {
  width: 48px;
  height: 48px;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.upload-zone__content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.upload-zone__content p {
  color: var(--gray-600);
  font-size: 0.875rem;
}

/* Form Elements */
.form-section {
  margin-bottom: 1.5rem;
}

.form-section label {
  display: block;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-family: "Fira Code", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
  transition: var(--transition);
  background: var(--white);
}

textarea:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea[readonly] {
  background: var(--gray-50);
  color: var(--gray-700);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  justify-content: center;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary-purple);
  color: var(--white);
  box-shadow: var(--shadow);
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-purple-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

.btn--outline {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn--outline:hover:not(:disabled) {
  background: var(--gray-50);
  color: var(--gray-900);
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.btn i {
  width: 16px;
  height: 16px;
}

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

/* Progress Bar */
.assessment-progress {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

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

.progress-title {
  font-weight: 500;
  color: var(--gray-900);
}

.progress-count {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-purple),
    var(--primary-purple-light)
  );
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.progress-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
}

.progress-section--pending {
  background: var(--gray-100);
  color: var(--gray-600);
}

.progress-section--processing {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-purple);
}

.progress-section--completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.progress-section--error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

.progress-section--weak {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
  border: 2px solid var(--red);
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.progress-section-icon {
  width: 14px;
  height: 14px;
}

/* Processing animation */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.progress-section--processing {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Assessment Status */
.assessment-status {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 0.875rem;
  color: var(--gray-600);
}

.assessment-status--processing {
  color: var(--primary-purple);
}

.assessment-status--completed {
  color: var(--green);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  text-align: center;
  min-width: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--gray-700);
  font-weight: 500;
}

/* Processing Status Indicator */
.processing-status {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  color: white;
  box-shadow: var(--shadow-md);
}

.processing-status__content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.processing-status__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.processing-status__icon i {
  width: 1.25rem;
  height: 1.25rem;
}

.processing-status__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.processing-status__title {
  font-weight: 600;
  font-size: 1rem;
}

.processing-status__subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
}

.processing-status__stats {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.processing-status__stats .stat-item {
  font-size: 0.875rem;
  opacity: 0.95;
}

.processing-status__stats .stat-item strong {
  font-weight: 700;
  font-size: 1rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.5rem;
  border-left: 4px solid;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateX(100%);
  transition: var(--transition);
}

.toast.show {
  transform: translateX(0);
}

.toast--success {
  border-left-color: var(--green);
}

.toast--error {
  border-left-color: var(--red);
}

.toast--info {
  border-left-color: var(--blue);
}

.toast--warning {
  border-left-color: var(--orange);
}

.toast__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast--success .toast__icon {
  color: var(--green);
}

.toast--error .toast__icon {
  color: var(--red);
}

.toast--info .toast__icon {
  color: var(--blue);
}

.toast--warning .toast__icon {
  color: var(--orange);
}

.toast__content {
  flex: 1;
}

.toast__title {
  font-weight: 500;
  color: var(--gray-900);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.toast__message {
  color: var(--gray-600);
  font-size: 0.75rem;
}

.toast__close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.toast__close:hover {
  color: var(--gray-600);
  background: var(--gray-100);
}

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

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }

  .main-header {
    padding: 1rem;
  }

  .header__center {
    margin: 0 1rem;
  }

  .content-area {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page-title {
    font-size: 1.25rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .card__header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .card__body {
    padding: 1rem;
  }

  .upload-zone {
    padding: 2rem 1rem;
  }
}
