/* 
 * Slate & Terracotta Theme for Brian's Developer Portfolio
 * Colors inspired by the user's provided palette:
 * - Top header/Sidebar: Dark Slate-Blue (#2c3e50)
 * - Accent highlights/Hover buttons: Terracotta Rose-Brown (#8e6e66)
 * - Background: Light pastel gray-blue gradient (#f3f6f9)
 * - Cards & Panels: Clean White (#ffffff)
 */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #f4f6f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --border-color: rgba(44, 62, 80, 0.1);
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  /* Slate & Terracotta Palette */
  --accent-cyan: #8e6e66; /* Terracotta Primary Action */
  --accent-cyan-glow: rgba(142, 110, 102, 0.2);
  --accent-emerald: #2c3e50; /* Slate Blue Header */
  --accent-emerald-glow: rgba(44, 62, 80, 0.15);
  --accent-blue: #4a5568;
  --accent-blue-glow: rgba(74, 85, 104, 0.1);
  
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Overrides */
body {
  background-color: var(--bg-primary);
  background: linear-gradient(135deg, #f4f6f9 0%, #e9eff4 100%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--accent-emerald);
  font-weight: 700;
}

/* Sidebar Custom Styling - Matches top dark bar in screenshot */
#sideNav {
  background-color: var(--accent-emerald) !important;
  border-right: 1px solid var(--border-color);
  box-shadow: 4px 0 24px rgba(44, 62, 80, 0.08);
}

#sideNav .navbar-brand {
  margin-bottom: 2rem;
}

#sideNav .navbar-nav .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  transition: var(--transition);
  border-radius: 8px;
  margin: 0.2rem 1rem;
}

#sideNav .navbar-nav .nav-item .nav-link:hover,
#sideNav .navbar-nav .nav-item .nav-link.active {
  color: #ffffff !important;
  background-color: var(--accent-cyan);
  box-shadow: 0 4px 12px var(--accent-cyan-glow);
}

.img-profile {
  border: 4px solid var(--accent-cyan) !important;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
  transition: var(--transition);
}

.img-profile:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px var(--accent-cyan);
}

/* Sections Styling */
.resume-section {
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
  border-bottom: 1px solid var(--border-color) !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.text-primary {
  color: var(--accent-cyan) !important;
}

.subheading {
  font-family: var(--font-sans);
  color: var(--text-secondary) !important;
  font-weight: 600;
}

.lead {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Social Icons */
.social-icons .social-icon {
  background-color: var(--bg-secondary) !important;
  color: var(--accent-emerald) !important;
  border: 1px solid var(--border-color) !important;
  transition: var(--transition);
  width: 3.5rem;
  height: 3.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.social-icons .social-icon:hover {
  background-color: var(--accent-cyan) !important;
  color: #ffffff !important;
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--accent-cyan-glow);
  border-color: var(--accent-cyan) !important;
}

/* CLI Interactive Terminal Widget - Kept Dark for Contrast */
.terminal-container {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  font-family: var(--font-mono);
  margin-bottom: 3rem;
  width: 100%;
}

.terminal-header {
  background: #1e293b;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-btn.close { background: #ef4444; }
.terminal-btn.minimize { background: #f59e0b; }
.terminal-btn.maximize { background: #10b981; }

.terminal-title {
  color: #94a3b8;
  font-size: 13px;
  margin-left: 20px;
  flex-grow: 1;
}

.terminal-body {
  padding: 20px;
  height: 300px;
  overflow-y: auto;
  color: #38bdf8;
  font-size: 14px;
  line-height: 1.6;
}

.terminal-output {
  margin-bottom: 15px;
}

.terminal-output p {
  margin: 4px 0;
  word-break: break-all;
}

.terminal-prompt {
  display: flex;
  align-items: center;
}

.terminal-prompt-symbol {
  color: #4ade80;
  margin-right: 8px;
  font-weight: bold;
}

.terminal-input {
  background: transparent;
  border: none;
  color: #ffffff;
  outline: none;
  font-family: var(--font-mono);
  font-size: 14px;
  flex-grow: 1;
  caret-color: #38bdf8;
}

.terminal-shortcuts {
  padding: 10px 20px;
  background: rgba(30, 41, 59, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.terminal-shortcuts-title {
  font-size: 12px;
  color: #64748b;
  margin-right: 5px;
}

.terminal-shortcut-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.terminal-shortcut-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Portfolio Projects Section */
.portfolio-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-cyan);
  color: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 12px var(--accent-cyan-glow);
  transform: translateY(-2px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  width: 100%;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 4px 15px rgba(44, 62, 80, 0.04);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  opacity: 0;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(142, 110, 102, 0.3);
  box-shadow: 0 12px 25px rgba(44, 62, 80, 0.08);
}

.project-card:hover::before {
  opacity: 1;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-date {
  background: rgba(142, 110, 102, 0.08);
  border: 1px solid rgba(142, 110, 102, 0.15);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.project-category {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
}

.project-category.course {
  background: rgba(44, 62, 80, 0.08);
  color: var(--accent-emerald);
}

.project-category.side-project {
  background: rgba(142, 110, 102, 0.08);
  color: var(--accent-cyan);
}

.project-category.contest {
  background: rgba(229, 62, 62, 0.08);
  color: #e53e3e;
}

.project-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 12px;
  line-height: 1.4;
}

.project-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.project-tag {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

.project-links {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

.project-link-btn {
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
  text-decoration: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
}

.project-link-btn:hover {
  color: #ffffff;
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  transform: scale(1.08);
}

/* Experience & Education Timelines */
.resume-section-content {
  width: 100%;
}

.timeline-item {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid var(--border-color);
  margin-bottom: 30px;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
  transition: var(--transition);
}

.timeline-item:hover::after {
  background: var(--accent-cyan);
  transform: scale(1.2);
}

.timeline-date {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

/* Override dark panels for Awards to use light design */
.card.bg-dark {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
  border-radius: 12px;
}

/* Admin / Login Panel UI */
.admin-section {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: #e9eff4;
}

.admin-trigger-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.admin-trigger-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 4px 12px var(--accent-cyan-glow);
}

/* Modal Overlay Styling - Adjusted to light mode */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(44, 62, 80, 0.5); /* Slate gray dark overlay */
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.custom-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(44, 62, 80, 0.15);
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}

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

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: #ef4444;
}

.modal-content-body {
  padding: 24px;
}

.modal-content-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control-custom {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: var(--transition);
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
  background: #ffffff;
}

.form-control-custom::placeholder {
  color: #a0aec0;
}

/* Buttons inside Modal */
.btn-custom {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-custom-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-custom-secondary:hover {
  background: #edf2f7;
  color: var(--text-primary);
}

.btn-custom-primary {
  background: var(--accent-cyan);
  color: #ffffff;
}

.btn-custom-primary:hover {
  background: #7a5a52;
  box-shadow: 0 4px 12px var(--accent-cyan-glow);
  transform: translateY(-1px);
}

.btn-custom-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.btn-custom-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Admin Card Actions */
.admin-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: var(--transition);
  z-index: 5;
}

.project-card:hover .admin-card-actions {
  opacity: 1;
}

.admin-card-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.admin-card-btn.edit {
  background: rgba(142, 110, 102, 0.1);
  border-color: rgba(142, 110, 102, 0.2);
  color: var(--accent-cyan);
}

.admin-card-btn.edit:hover {
  background: var(--accent-cyan);
  color: #ffffff;
}

.admin-card-btn.delete {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.admin-card-btn.delete:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Admin Dashboard Bar */
.admin-dashboard-bar {
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed #10b981;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-status-text {
  font-size: 14px;
  color: #10b981;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-actions {
  display: flex;
  gap: 12px;
}

/* Alert inside Admin Login */
.alert-info-custom {
  background: rgba(44, 62, 80, 0.05);
  border: 1px solid rgba(44, 62, 80, 0.1);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.alert-info-custom code {
  color: var(--accent-cyan);
  background: #edf2f7;
  padding: 2px 4px;
  border-radius: 4px;
}

/* Resume Cover Header styling */
.resume-cover-header {
  position: relative;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, #1e293b 100%);
  padding: 40px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(44, 62, 80, 0.08);
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  width: 100%;
}

.resume-cover-header h2 {
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  margin-top: 8px;
  margin-bottom: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Blog Panel Slide-over View */
.project-blog-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 700px;
  height: 100vh;
  background: #ffffff;
  z-index: 1200;
  box-shadow: -10px 0 35px rgba(44, 62, 80, 0.15);
  transition: right 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
}

.project-blog-panel.show {
  right: 0;
}

.blog-panel-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow-y: auto;
}

.blog-panel-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.blog-back-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.blog-back-btn:hover {
  color: var(--accent-cyan);
}

.blog-project-date {
  background: rgba(142, 110, 102, 0.08);
  border: 1px solid rgba(142, 110, 102, 0.15);
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.blog-panel-body {
  padding: 30px 24px;
  color: var(--text-primary);
}

.blog-project-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-emerald);
  margin-bottom: 10px;
}

.blog-video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
  margin-bottom: 24px;
}

.blog-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.blog-project-content {
  line-height: 1.8;
  font-size: 15px;
  color: var(--text-secondary);
}

.blog-project-content h3, .blog-project-content h4 {
  color: var(--accent-emerald);
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 700;
}

.blog-project-content p {
  margin-bottom: 16px;
}

.blog-project-content ul {
  padding-left: 20px;
  margin-bottom: 20px;
}

.blog-project-content li {
  margin-bottom: 8px;
}

/* Mobile Responsiveness for Resume */
@media (max-width: 992px) {
  .resume-section {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
}

@media (max-width: 576px) {
  .resume-cover-header {
    padding: 24px 20px;
    min-height: 140px;
  }
  .resume-cover-header h2 {
    font-size: 20px;
  }
  .blog-panel-body {
    padding: 20px 16px;
  }
  .blog-project-title {
    font-size: 22px;
  }
  .project-blog-panel {
    max-width: 100%;
  }
}

/* Project Card Cover Image */
.project-card-cover {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 16px;
  background: #0f172a;
  border: 1px solid var(--border-color);
}

.project-card-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-card-cover img {
  transform: scale(1.06);
}

.tech-gradient-placeholder {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.tech-gradient-placeholder i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: #ffffff;
  opacity: 0.6;
}

.video-play-indicator {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(44, 62, 80, 0.85);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
