/* Modern CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Modern Design System - Dark Google Theme */
:root {
  /* Google Dark Theme Colors */
  --primary: #a5870d;
  --primary-dark: #669df6;
  --primary-light: #aecbfa;
  --secondary: #fdd663;
  --success: #4d7c5b;
  --warning: #968249;
  --error: #6e231c;
  --info: #8ab4f8;
  
  /* Dark Theme Grays */
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f4;
  --gray-200: #e8eaed;
  --gray-300: #dadce0;
  --gray-400: #9aa0a6;
  --gray-500: #5f6368;
  --gray-600: #3c4043;
  --gray-700: #303134;
  --gray-800: #202124;
  --gray-900: #171717;
  
  /* Dark Background System */
  --bg-primary: #202124;
  --bg-secondary: #303134;
  --bg-tertiary: #3c4043;
  --bg-surface: #292a2d;
  
  /* Text Colors */
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-tertiary: #5f6368;
  
  /* Dark Theme Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Cascadia Code', monospace;
}

/* Global Styles */
body {
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 2rem 2rem;
}

/* App Header */
.app-header {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--primary);
}

.header-content {
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

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

.brand-logo {
  font-size: 2rem;
  animation: pulse 2s infinite;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  color: white;
}

.brand-text p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 300;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-file-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.header-file-upload input[type="file"] {
  background: none;
  border: none;
  color: white;
  font-size: 0.875rem;
  width: auto;
}

.header-file-upload input[type="file"]::-webkit-file-upload-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 0.5rem;
}

.header-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  backdrop-filter: blur(10px);
}

.header-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.875rem;
}

.header-tab:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.header-tab.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-status {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.main-header {
  text-align: center;
  margin-bottom: 3rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.main-header h1 {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, #ffffff, #f3f4f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-header p {
  font-size: 1.2rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Cards */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-600);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--gray-500);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-600);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Action Cards */
.action-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--info);
  position: relative;
}

/* Warning Cards */
.warning-card {
  background: rgba(253, 214, 99, 0.1);
  border: 1px solid var(--warning);
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

/* Success Cards */
.success-card {
  background: rgba(129, 201, 149, 0.1);
  border: 1px solid var(--success);
  margin-bottom: 1.5rem;
}

/* Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: var(--bg-primary);
}

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

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

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-600);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
}

.btn-error {
  background: var(--error);
  opacity: 0.7 ;
  color: white;
}

.btn-error:hover:not(:disabled) {
  background: #dc2626;
}

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

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 0.3rem;
}

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

.form-input, .input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input:focus, .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2);
  transform: translateY(-1px);
}

.form-input:hover, .input:hover {
  border-color: var(--gray-500);
}

.form-input::placeholder, .input::placeholder {
  color: var(--text-tertiary);
}

/* Checkbox & Radio */
.checkbox, .radio {
  width: auto;
  margin-right: 0.5rem;
  accent-color: var(--primary);
}

/* File Input */
.file-input {
  padding: 0.5rem;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  transition: all 0.2s ease;
}

.file-input:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* Tab System */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--gray-800);
  background: var(--gray-100);
}

.tab.active {
  color: var(--primary);
  background: white;
  border-bottom: 2px solid var(--primary);
}

/* Layout Grids */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr);  margin-top: 0.5rem;}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
  display: flex;
  gap: 1rem;
  margin: 20px;
}

.flex-col {
  flex-direction: column;
}

.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Sidebar Preview - Google Dark Theme */
.sidebar-preview {
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-600);
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  min-height: 600px;
}

.sidebar-preview::-webkit-scrollbar {
  width: 6px;
}

.sidebar-preview::-webkit-scrollbar-track {
  background: var(--gray-700);
  border-radius: 3px;
}

.sidebar-preview::-webkit-scrollbar-thumb {
  background: var(--gray-500);
  border-radius: 3px;
}

.sidebar-preview::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Sidebar Menu Items */
.sidebar-menu-item:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  transform: translateX(2px);
}

.sidebar-menu-item:active {
  background: rgba(138, 180, 248, 0.2) !important;
}

/* Menu Cards - Dark Theme */
.menu-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
  border: 1px solid var(--gray-600);
  transition: all 0.3s ease;
  overflow: hidden;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.menu-card-header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--gray-600);
  padding: 1rem 1.5rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.menu-card-header:hover {
  background: var(--gray-600);
}

.menu-card-header.expanded {
  background: rgba(138, 180, 248, 0.1);
  border-bottom-color: var(--primary);
}

.menu-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.menu-card-title-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.menu-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.menu-card-badge {
  background: var(--gray-600);
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.menu-card-toggle {
  color: var(--primary);
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.menu-card-toggle.expanded {
  transform: rotate(90deg);
}

.menu-card-content {
  padding: 0 1.5rem 1.5rem;
  margin-top: 0.5rem;
}

/* Menu Group Cards */
.menu-group-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

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

.menu-group-card-header {
  background: var(--bg-tertiary);
  border-radius: 20px;
  border-bottom: 1px solid var(--gray-600);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  user-select: none;
}

.menu-group-card-header:hover {
  background: var(--gray-600);
}

.menu-group-card-header.expanded {
  background: rgba(138, 180, 248, 0.1);
  border-bottom-color: var(--primary);
}

.menu-group-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-group-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.submenu-container {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--info);
}

.submenu-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Menu Items Section */
.menu-items-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--gray-600);
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--success);
}

.menu-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-600);
}

.menu-items-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-preview h4 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-group {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
}

.menu-group-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-item {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--gray-600);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  color: var(--text-primary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { 
    opacity: 0; 
    transform: translateY(-10px);
    max-height: 0;
  }
  to { 
    opacity: 1; 
    transform: translateY(0);
    max-height: 300px;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 1rem;
  }
  
  .flex {
    flex-direction: column;
  }
  
  .sidebar-preview {
    position: static;
    max-height: 60vh;
    order: -1; /* Önce preview göster mobile'da */
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .main-header h1 {
    font-size: 2rem;
  }
  
  .main-header p {
    font-size: 1rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .card-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .tabs {
    justify-content: center;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .btn-sm {
    width: auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }
  
  .main-header h1 {
    font-size: 1.5rem;
  }
  
  .card {
    margin-bottom: 1rem;
    padding: 0.75rem;
  }
}



/* Collapsible Page Cards */
.card-header {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.card-header:hover {
  background-color: var(--bg-tertiary);
}

.card-body {
  animation: slideDown 0.3s ease-out;
  overflow: hidden;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 2000px;
    transform: translateY(0);
  }
}

/* Collapse arrow animation */
.card-title span {
  display: inline-block;
  transition: transform 0.2s ease;
}
