/* ===================================
   Minimal Personal Blog - Emre Özcan
   Sidebar Layout - Single Page Design
   =================================== */

/* === CSS Variables === */
:root {
  /* Colors - Light Theme */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-light: #f8fafc;
  --bg-sidebar: #1e293b;
  --bg-white: #ffffff;
  --bg-gray: #f1f5f9;
  --text-dark: #0f172a;
  --text-medium: #475569;
  --text-light: #64748b;
  --border-color: #e2e8f0;
  --app-bg: #ebf0f7;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Dimensions */
  --sidebar-width: 280px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

body.dark {
  --app-bg: #0f172a;
  --bg-white: #1e293b;
  --bg-gray: #334155;
  --text-dark: #f8fafc;
  --text-medium: #cbd5e1;
  --text-light: #94a3b8;
  --border-color: #334155;
}

/* === Global Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--app-bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: hidden;
  /* Ensure centering logic works without offsets */
  transition: background-color var(--transition-normal), color var(--transition-normal);
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* === App Container === */
.app-container {
  display: flex;
  width: 95%;
  max-width: 1200px;
  height: 90vh;
  gap: var(--spacing-lg);
  align-items: stretch;
  margin: auto;
  /* Extra insurance for centering */
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

h1 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-medium);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-normal);
}

a:hover {
  color: var(--primary-hover);
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  border-radius: 1.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-content {
  padding: 1.5rem var(--spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

/* === Profile Photo === */
.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: var(--spacing-lg);
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  color: #ffffff !important;
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xs);
  text-align: center;
  display: block;
}

.profile-title {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* === Sidebar Navigation === */
.sidebar-nav {
  width: 100%;
  margin-bottom: auto;
}

.sidebar-nav ul {
  list-style: none;
  width: 100%;
}

.sidebar-nav li {
  margin-bottom: 0.15rem;
}

.sidebar-nav ul li a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.9rem;
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li a.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(5px);
}

/* Theme & Lang Controls */
.sidebar-controls {
  margin-top: auto;
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.control-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* === Sidebar Social === */
.social-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  /* Lighter text for title */
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.sidebar-social {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--spacing-xs);
  width: 100%;
}

.sidebar-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  /* Smaller size */
  height: 32px;
  /* Smaller size */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition-fast);
  position: relative;
  /* For tooltip */
}

.sidebar-social a:hover {
  background-color: var(--primary-color);
  color: var(--bg-white);
  transform: translateY(-2px);
}

.sidebar-social a svg {
  width: 16px;
  height: 16px;
}

/* Tooltip */
.sidebar-social a::after {
  content: attr(aria-label);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background-color: #222;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.sidebar-social a:hover::after {
  opacity: 1;
}

/* === Main Content === */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-white);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transition: background-color var(--transition-normal);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Mobile Optimizations === */
@media (max-width: 768px) {
  .sidebar-nav ul li a {
    min-height: 44px;
    /* Touch friendly */
    display: flex;
    align-items: center;
  }

  .control-btn {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }

  .sidebar-social a {
    width: 44px;
    height: 44px;
  }
}

.content-wrapper {
  padding: var(--spacing-xl);
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.intro-text {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-medium);
  margin-bottom: var(--spacing-md);
}

.intro-text strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* === About Page Specific === */
.about-page {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.about-page h2 {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-md);
}

.about-page h3 {
  color: var(--text-dark);
  font-size: 1.25rem;
}

.skills-compact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.skills-compact span {
  background-color: var(--bg-light);
  color: var(--primary-color);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

@media (max-width: 992px) {
  body {
    overflow: auto;
    padding: var(--spacing-md);
    height: auto;
  }

  .app-container {
    flex-direction: column;
    height: auto;
    gap: var(--spacing-md);
  }

  .sidebar {
    width: 100%;
  }

  .main-content {
    width: 100%;
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .profile-photo {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .sidebar-content {
    padding: var(--spacing-md);
  }

  .profile-photo {
    width: 100px;
    height: 100px;
  }

  .content-wrapper {
    padding: var(--spacing-md);
  }

  .sidebar-social a {
    width: 36px;
    height: 36px;
  }
}

/* === Utility Classes === */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: var(--spacing-sm);
}

.mt-2 {
  margin-top: var(--spacing-md);
}

.mt-3 {
  margin-top: var(--spacing-lg);
}

.mt-4 {
  margin-top: var(--spacing-xl);
}

.mb-1 {
  margin-bottom: var(--spacing-sm);
}

.mb-2 {
  margin-bottom: var(--spacing-md);
}

.mb-3 {
  margin-bottom: var(--spacing-lg);
}

.mb-4 {
  margin-bottom: var(--spacing-xl);
}

/* === Services Page === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border-color: var(--primary-color);
}

.service-card h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.service-card p {
  font-size: 0.9rem;
  color: var(--text-medium);
  line-height: 1.5;
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  border-radius: 12px;
}