/* ================================================
   BASE CLASS MAPPING
   ana-author = ana-card (Frontend uyumluluk)
   ================================================ */

.ana-author {
    /* Tüm ana-card stilleri otomatik uygulanır */
}

/* Frontend list container */
.ana-list-frontend {
    /* ana-list ile aynı */
}

/* ===================================
   AleviNet Author Pro - Frontend Styles
   Version: 2.0.0
   Professional Typography, Colors, Spacing & Animations
   =================================== */

/* ===== DESIGN TOKENS & CSS VARIABLES ===== */
:root {
  /* Typography Scale */
  --ana-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --ana-font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --ana-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  /* Font Sizes (customizable via widget settings) */
  --ana-font-size: 14px;
  --ana-font-weight: 400;
  --ana-name-size: 18px;
  --ana-name-weight: 700;
  --ana-line-height-tight: 1.2;
  --ana-line-height-normal: 1.5;
  --ana-line-height-relaxed: 1.75;
  --ana-letter-spacing: -0.01em;
  
  /* Color Palette (customizable via widget settings) */
  --ana-link: inherit;
  --ana-link-hover: inherit;
  
  /* Default Colors (fallback) */
  --ana-text-primary: #1f2937;
  --ana-text-secondary: #6b7280;
  --ana-text-muted: #9ca3af;
  
  --ana-bg-white: #ffffff;
  --ana-bg-gray-50: #f9fafb;
  --ana-bg-gray-100: #f3f4f6;
  
  --ana-border-light: #e5e7eb;
  --ana-border-medium: #d1d5db;
  --ana-border-dark: #9ca3af;
  
  /* Layout Variables (customizable via widget settings) */
  --ana-gap: 16px;
  --ana-avatar-size: 72px;
  --ana-border-radius: 12px;
  --ana-cols-desk: 3;
  --ana-cols-tab: 2;
  --ana-cols-mob: 1;
  --ana-lines: 2;
  
  /* Spacing Scale */
  --ana-space-1: 4px;
  --ana-space-2: 8px;
  --ana-space-3: 12px;
  --ana-space-4: 16px;
  --ana-space-5: 20px;
  --ana-space-6: 24px;
  --ana-space-8: 32px;
  
  /* Shadow Tokens */
  --ana-shadow-none: none;
  --ana-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --ana-shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
  --ana-shadow-strong: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.07);
  
  /* Transition Tokens */
  --ana-transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ana-transition-medium: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --ana-transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE WIDGET CONTAINER ===== */
.ana-widget {
  position: relative;
  isolation: isolate;
  z-index: 1;
  display: block;
  font-family: var(--ana-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== WIDGET LIST ===== */
.ana-list-frontend {
  display: flex;
  flex-direction: column;
  gap: var(--ana-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ===== AUTHOR CARD - BASE ===== */
.ana-author {
  display: flex;
  align-items: center;
  gap: var(--ana-space-3);
  padding: var(--ana-space-4);
  border-radius: var(--ana-border-radius);
  border: 1px solid var(--ana-border-light);
  background: var(--ana-bg-white);
  transition: all var(--ana-transition-medium);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

/* ===== CARD STYLES ===== */

/* Card Style (with shadow) */
.ana-style-card .ana-author {
  box-shadow: var(--ana-shadow-medium);
}

.ana-style-card .ana-author:hover {
  background: var(--ana-bg-gray-50);
  border-color: var(--ana-border-medium);
}

/* Flat Style (minimalist) */
.ana-style-flat .ana-author {
  background: transparent;
  border: 1px solid var(--ana-border-light);
  box-shadow: none;
}

.ana-style-flat .ana-author:hover {
  background: var(--ana-bg-gray-50);
  border-color: var(--ana-border-medium);
}

/* ===== SHADOW INTENSITY VARIANTS ===== */
.ana-shadow-none .ana-author {
  box-shadow: none !important;
}

.ana-shadow-light .ana-author {
  box-shadow: var(--ana-shadow-light);
}

.ana-shadow-medium .ana-author {
  box-shadow: var(--ana-shadow-medium);
}

.ana-shadow-strong .ana-author {
  box-shadow: var(--ana-shadow-strong);
}

/* ===== TRANSITION SPEED VARIANTS ===== */
.ana-transition-fast .ana-author {
  transition: all var(--ana-transition-fast);
}

.ana-transition-medium .ana-author {
  transition: all var(--ana-transition-medium);
}

.ana-transition-slow .ana-author {
  transition: all var(--ana-transition-slow);
}

/* ===== HOVER LIFT EFFECT ===== */
.ana-hover-lift .ana-author:hover {
  transform: translateY(-4px);
  box-shadow: var(--ana-shadow-strong);
}

/* ===== AVATAR CONTAINER ===== */
.ana-avatar {
  flex-shrink: 0;
  max-width: var(--ana-avatar-size);
  max-height: var(--ana-avatar-size);
  position: relative;
  overflow: hidden;
  border-radius: var(--ana-space-2);
}

/* Avatar Image - Default (Square with rounded corners) */
.ana-avatar img.avatar {
  width: auto !important;
  height: auto !important;
  max-width: var(--ana-avatar-size) !important;
  max-height: var(--ana-avatar-size) !important;
  object-fit: contain !important;
  border-radius: var(--ana-space-2);
  box-shadow: none;
  display: block;
  transition: transform var(--ana-transition-medium);
}

/* Circle Avatar (cropped) */
.ana-widget[data-avatar-shape="circle"] .ana-avatar {
  border-radius: 50%;
}

.ana-widget[data-avatar-shape="circle"] .ana-avatar img.avatar {
  width: var(--ana-avatar-size) !important;
  height: var(--ana-avatar-size) !important;
  object-fit: cover !important;
  border-radius: 50%;
}

/* Avatar hover effect */
.ana-author:hover .ana-avatar img.avatar {
  transform: scale(1.05);
}

/* ===== AUTHOR METADATA ===== */
.ana-meta {
  display: flex;
  flex-direction: column;
  gap: var(--ana-space-1);
  min-width: 0;
  flex: 1;
}

/* ===== AUTHOR NAME ===== */
.ana-name {
  font-size: var(--ana-name-size);
  font-weight: var(--ana-name-weight);
  line-height: var(--ana-line-height-tight);
  letter-spacing: var(--ana-letter-spacing);
  color: var(--ana-text-primary);
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ===== LATEST POST LINK ===== */
.ana-latest {
  font-size: var(--ana-font-size);
  font-weight: var(--ana-font-weight);
  line-height: var(--ana-line-height-normal);
  color: var(--ana-link);
  text-decoration: none;
  
  /* Multi-line truncation */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--ana-lines);
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  hyphens: auto;
  
  transition: color var(--ana-transition-fast);
}

.ana-latest:hover {
  color: var(--ana-link-hover);
  text-decoration: underline;
}

/* Empty state - no posts */
.ana-latest.ana-none {
  color: var(--ana-text-muted);
  font-style: italic;
  opacity: 0.7;
}

/* ===== LAYOUT: HORIZONTAL GRID ===== */
.ana-layout-horizontal .ana-list-frontend {
  display: grid;
  gap: var(--ana-gap);
  grid-template-columns: repeat(var(--ana-cols-desk), 1fr);
}

/* Horizontal: Center aligned cards */
.ana-layout-horizontal .ana-author {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ana-layout-horizontal .ana-meta {
  align-items: center;
  width: 100%;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .ana-layout-horizontal .ana-list-frontend {
    grid-template-columns: repeat(var(--ana-cols-tab), 1fr);
  }
  
  /* Reduce spacing on smaller screens */
  :root {
    --ana-gap: 12px;
  }
  
  .ana-author {
    padding: var(--ana-space-3);
  }
}

/* Mobile (max-width: 640px) */
@media (max-width: 640px) {
  .ana-layout-horizontal .ana-list-frontend {
    grid-template-columns: repeat(var(--ana-cols-mob), 1fr);
  }
  
  /* Further reduce spacing */
  :root {
    --ana-gap: 10px;
  }
  
  .ana-author {
    padding: var(--ana-space-3);
    gap: var(--ana-space-2);
  }
  
  /* Smaller font sizes on mobile */
  .ana-name {
    font-size: calc(var(--ana-name-size) * 0.9);
  }
  
  .ana-latest {
    font-size: calc(var(--ana-font-size) * 0.95);
  }
}

/* ===== LOADING & SKELETON STATES ===== */
.ana-loading {
  opacity: 0.6;
  pointer-events: none;
}

.ana-skeleton {
  background: linear-gradient(
    90deg,
    var(--ana-bg-gray-100) 0%,
    var(--ana-bg-gray-50) 50%,
    var(--ana-bg-gray-100) 100%
  );
  background-size: 200% 100%;
  animation: anaSkeletonPulse 1.5s ease-in-out infinite;
  border-radius: var(--ana-border-radius);
}

@keyframes anaSkeletonPulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== ANIMATIONS ===== */

/* Fade in animation for widgets */
@keyframes anaFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ana-widget {
  animation: anaFadeIn 0.5s ease-out;
}

/* Stagger animation for multiple cards */
.ana-author {
  animation: anaFadeIn 0.4s ease-out backwards;
}

.ana-author:nth-child(1) { animation-delay: 0.05s; }
.ana-author:nth-child(2) { animation-delay: 0.1s; }
.ana-author:nth-child(3) { animation-delay: 0.15s; }
.ana-author:nth-child(4) { animation-delay: 0.2s; }
.ana-author:nth-child(5) { animation-delay: 0.25s; }
.ana-author:nth-child(6) { animation-delay: 0.3s; }

/* ===== ACCESSIBILITY ===== */

/* Focus states */
.ana-author:focus,
.ana-latest:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.ana-author:focus:not(:focus-visible),
.ana-latest:focus:not(:focus-visible) {
  outline: none;
}

.ana-author:focus-visible,
.ana-latest:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to content for keyboard users */
.ana-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2563eb;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 100;
}

.ana-skip-link:focus {
  top: 0;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  .ana-author {
    border-width: 2px;
    border-color: currentColor;
  }
  
  .ana-latest {
    text-decoration: underline;
  }
  
  .ana-name {
    font-weight: 800;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .ana-hover-lift .ana-author:hover {
    transform: none;
  }
  
  .ana-author:hover .ana-avatar img.avatar {
    transform: none;
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --ana-text-primary: #f9fafb;
    --ana-text-secondary: #d1d5db;
    --ana-text-muted: #9ca3af;
    
    --ana-bg-white: #1f2937;
    --ana-bg-gray-50: #111827;
    --ana-bg-gray-100: #374151;
    
    --ana-border-light: #374151;
    --ana-border-medium: #4b5563;
    --ana-border-dark: #6b7280;
  }
  
  .ana-author {
    background: var(--ana-bg-white);
  }
  
  .ana-style-card .ana-author:hover,
  .ana-style-flat .ana-author:hover {
    background: var(--ana-bg-gray-100);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .ana-widget {
    page-break-inside: avoid;
  }
  
  .ana-author {
    box-shadow: none !important;
    border: 1px solid #000;
  }
  
  .ana-latest {
    color: #000 !important;
    text-decoration: underline;
  }
  
  /* Show URLs in print */
  .ana-latest::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    color: #666;
  }
}

/* ===== RTL SUPPORT ===== */
[dir="rtl"] .ana-author {
  direction: rtl;
}

[dir="rtl"] .ana-meta {
  text-align: right;
}

[dir="rtl"] .ana-layout-horizontal .ana-meta {
  text-align: center;
}

/* ===== UTILITY CLASSES ===== */
.ana-hidden {
  display: none !important;
}

.ana-invisible {
  visibility: hidden !important;
}

.ana-error {
  padding: var(--ana-space-4);
  background: #fee2e2;
  border: 1px solid #dc2626;
  border-radius: var(--ana-border-radius);
  color: #991b1b;
  font-weight: 500;
}

.ana-empty {
  padding: var(--ana-space-8);
  text-align: center;
  color: var(--ana-text-muted);
  font-style: italic;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* GPU acceleration for transforms */
.ana-author,
.ana-avatar img.avatar {
  will-change: transform;
}

/* Contain layout shifts */
.ana-avatar {
  contain: layout style;
}

/* Lazy loading support */
img.avatar[loading="lazy"] {
  content-visibility: auto;
}

/* ================================================
   LAYOUT ALTERNATİFLERİ
   ================================================ */

/* GRID Layout (Varsayılan) */
.ana-layout-grid .ana-list,
.ana-layout-grid .ana-list-frontend {
    display: grid;
    grid-template-columns: repeat(var(--ana-cols-desk, 3), 1fr);
    gap: var(--ana-gap, 24px);
}

@media (max-width: 768px) {
    .ana-layout-grid .ana-list,
    .ana-layout-grid .ana-list-frontend {
        grid-template-columns: repeat(var(--ana-cols-tab, 2), 1fr);
    }
}

@media (max-width: 480px) {
    .ana-layout-grid .ana-list,
    .ana-layout-grid .ana-list-frontend {
        grid-template-columns: repeat(var(--ana-cols-mob, 1), 1fr);
    }
}

/* LIST Layout */
.ana-layout-list .ana-list,
.ana-layout-list .ana-list-frontend {
    display: flex;
    flex-direction: column;
    gap: var(--ana-gap, 16px);
}

.ana-layout-list .ana-card,
.ana-layout-list .ana-author {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.ana-layout-list .ana-avatar {
    margin-right: 20px;
    flex-shrink: 0;
}

/* SLIDER Layout */
.ana-layout-slider {
    overflow: hidden;
    position: relative;
}

.ana-layout-slider .ana-list,
.ana-layout-slider .ana-list-frontend {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 24px;
    padding-bottom: 20px;
}

.ana-layout-slider .ana-card,
.ana-layout-slider .ana-author {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

.ana-layout-slider .ana-list::-webkit-scrollbar,
.ana-layout-slider .ana-list-frontend::-webkit-scrollbar {
    height: 8px;
}

.ana-layout-slider .ana-list::-webkit-scrollbar-track,
.ana-layout-slider .ana-list-frontend::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ana-layout-slider .ana-list::-webkit-scrollbar-thumb,
.ana-layout-slider .ana-list-frontend::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

/* MASONRY Layout */
.ana-layout-masonry .ana-list,
.ana-layout-masonry .ana-list-frontend {
    column-count: 3;
    column-gap: 24px;
}

.ana-layout-masonry .ana-card,
.ana-layout-masonry .ana-author {
    break-inside: avoid;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .ana-layout-masonry .ana-list,
    .ana-layout-masonry .ana-list-frontend {
        column-count: 1;
    }
}

/* ================================================
   STİL ALTERNATİFLERİ
   ================================================ */

/* MODERN Stil (Varsayılan - Gradient) */
.ana-style-modern .ana-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102,126,234,0.3);
}

.ana-style-modern .ana-name {
    color: white;
}

.ana-style-modern .ana-latest {
    color: rgba(255,255,255,0.9);
}

/* MINIMAL Stil */
.ana-style-minimal .ana-card {
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.ana-style-minimal .ana-name {
    color: #111827;
    font-weight: 600;
}

.ana-style-minimal .ana-latest {
    color: #6b7280;
}

.ana-style-minimal .ana-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* CLASSIC Stil */
.ana-style-classic .ana-card {
    background: #f9fafb;
    border: 2px solid #d1d5db;
    box-shadow: none;
}

.ana-style-classic .ana-name {
    color: #1f2937;
    font-family: Georgia, serif;
    font-weight: 700;
}

.ana-style-classic .ana-latest {
    color: #4b5563;
    font-style: italic;
}

.ana-style-classic .ana-card:hover {
    background: white;
    border-color: #9ca3af;
}

/* BOLD Stil */
.ana-style-bold .ana-card {
    background: #111827;
    color: white;
    border: 3px solid #667eea;
    box-shadow: 0 0 0 6px rgba(102,126,234,0.1);
}

.ana-style-bold .ana-name {
    color: #667eea;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ana-style-bold .ana-latest {
    color: #d1d5db;
}

.ana-style-bold .ana-card:hover {
    transform: scale(1.05);
    border-color: #764ba2;
}

/* ================================================
   ESKİ LAYOUT UYUMLULUK (Vertical/Horizontal)
   ================================================ */

/* Vertical = Grid */
.ana-layout-vertical .ana-list {
    display: grid;
    grid-template-columns: repeat(var(--ana-cols-desk, 3), 1fr);
    gap: var(--ana-gap, 24px);
}

@media (max-width: 768px) {
    .ana-layout-vertical .ana-list {
        grid-template-columns: repeat(var(--ana-cols-tab, 2), 1fr);
    }
}

@media (max-width: 480px) {
    .ana-layout-vertical .ana-list {
        grid-template-columns: repeat(var(--ana-cols-mob, 1), 1fr);
    }
}

/* Horizontal = List */
.ana-layout-horizontal .ana-list {
    display: flex;
    flex-direction: column;
    gap: var(--ana-gap, 16px);
}

.ana-layout-horizontal .ana-card {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.ana-layout-horizontal .ana-avatar {
    margin-right: 20px;
    flex-shrink: 0;
}
