:root {
  /* PREMIUM LIGHT THEME VARIABLES */
  --bg-color: #fafafa;
  --bg-secondary: #ffffff;
  --text-primary: #171717;
  --text-secondary: #666666;
  --text-muted: #a3a3a3;
  --accent-color: #35a976;
  --accent-hover: #2a8d61;
  --border-color: #e5e5e5;
  
  /* SHADOWS & EFFECTS */
  --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);
  --shadow-bento: 0 20px 40px rgba(0,0,0,0.04);
  
  /* TRANSITIONS */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* BORDER RADIUS */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

:root[data-theme="dark"] {
  /* PREMIUM DARK THEME VARIABLES (#121212 based) */
  --bg-color: #121212;
  --bg-secondary: #1a1a1a;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #666666;
  --accent-color: #4bbf8c;
  --accent-hover: #6dd3a8;
  --border-color: #2a2a2a;
  
  /* SHADOWS & EFFECTS FOR DARK */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-bento: 0 20px 40px rgba(0,0,0,0.2);
}

html {
  height: 100%;
}

html,
body {
  max-width: 100vw;
  /* clip: yatay taşmayı keser ama (hidden'ın aksine) kaydırma kabı oluşturmaz,
     böylece position: sticky header'lar çalışır */
  overflow-x: clip;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-geist-sans), Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-geist-sans), sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: 1.2;
}

p {
  line-height: 1.6;
  color: var(--text-secondary);
}

/* UTILITIES */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* BENTO BOX GRID BASE */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.bento-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.bento-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: var(--text-secondary);
}

/* ADMIN GLOBAL STYLES */
.form-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: inherit;
}
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.file-input-wrapper { margin-bottom: 1rem; }
.file-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; font-weight: 500; }

input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  background-color: var(--bg-color);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
input[type="file"]:hover {
  border-color: var(--accent-color);
  background-color: rgba(53, 169, 118, 0.05);
}
input[type="file"]::file-selector-button {
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border: none;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--transition-fast);
}
input[type="file"]::file-selector-button:hover {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.admin-list { list-style: none; padding: 0; }
.admin-list-item { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 1rem; 
  border: 1px solid var(--border-color); 
  border-radius: var(--radius-sm); 
  margin-bottom: 0.5rem; 
  background-color: var(--bg-color);
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.admin-main {
  margin-left: 260px; /* To prevent overlapping since sidebar is fixed */
  padding: 2rem;
  width: calc(100vw - 260px);
  min-height: 100vh;
  background-color: var(--bg-color);
}
.admin-content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-main {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    padding-top: 80px; /* space for mobile menu toggle if added later */
  }
}

/* PRELOADER STYLES */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.preloader .text {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* MICRO-ANIMATIONS */
@keyframes softFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: softFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

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

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

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* EXTRA APP CSS */
.portfolio-section { padding: 6rem 0; }
.dashboard { padding: 2rem; min-height: 100vh; background-color: var(--bg-color); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
textarea { width: 100%; padding: 1rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background-color: var(--bg-secondary); color: var(--text-primary); resize: vertical; }
.mt-2 { margin-top: 1rem; }

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
  border: 2px solid var(--bg-color);
}

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

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-color);
}

/* PROJECT DETAIL PAGE STYLES */
.project-detail-page {
  padding-top: 8rem;
  padding-bottom: 5rem;
  min-height: 80vh;
}
.project-header {
  margin-bottom: 3rem;
  text-align: center;
}
.project-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.project-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.project-image {
  margin-bottom: 4rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.project-image img {
  width: 100%;
  height: auto;
  display: block;
}
.project-content {
  max-width: 800px;
  margin: 0 auto;
}
.project-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}
.project-actions {
  text-align: center;
}