/* ============================================
   Liquid Glass Styles (Enhanced Mobile Design)
   롯데홈쇼핑 차세대 정책서 Wiki 시스템
   ============================================ */

/* ===== CSS Variables ===== */
:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-hover: #d1d5db;
  --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);
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 배경 그라데이션 ===== */
body.glass-theme {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #dfe4ea 100%);
    min-height: 100vh;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Mobile-First Improvements ===== */
@media (max-width: 767px) {
    .glass-nav {
        padding: 0.75rem 1rem;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .glass-nav .flex {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .glass-nav .text-base {
        font-size: 0.875rem;
    }
    
    .glass-nav .text-lg {
        font-size: 1rem;
    }
    
    .glass-nav .hidden {
        display: none;
    }
    
    .glass-nav .block {
        display: block;
    }
    
    .glass-card {
        margin: 0.75rem;
        padding: 1.25rem;
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-md);
        transition: all var(--transition-normal);
    }
    
    .glass-card:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }
    
    .glass-button {
        min-height: 48px;
        min-width: 48px;
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
        font-weight: 500;
        border-radius: var(--radius-lg);
        transition: all var(--transition-fast);
        box-shadow: var(--shadow-sm);
    }
    
    .glass-button:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }
    
    .glass-button:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    .glass-input {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: var(--radius-lg);
        padding: 0.875rem 1rem;
        transition: all var(--transition-fast);
    }
    
    .glass-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    
    /* Grid improvements */
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .md\\:grid-cols-2,
    .lg\\:grid-cols-3,
    .lg\\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Typography improvements */
    .text-2xl {
        font-size: 1.5rem;
    }
    
    .text-xl {
        font-size: 1.25rem;
    }
    
    .text-lg {
        font-size: 1.125rem;
    }
    
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
}

/* ===== Tablet Improvements ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lg\\:grid-cols-3,
    .lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Enhanced Components ===== */
.glass-nav {
    transition: all var(--transition-normal);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.glass-button {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.glass-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.glass-button-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.glass-button-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.glass-input {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(31, 38, 135, 0.12);
    color: #374151;
    transition: all var(--transition-fast);
}

.glass-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.glass-input::placeholder {
    color: #9ca3af;
}

/* ===== Touch Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    .glass-button:hover,
    .glass-card:hover {
        transform: none;
    }
    
    .glass-button,
    .glass-input,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Focus States ===== */
.focus-ring:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== Glass Card ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.08),
        0 2px 8px 0 rgba(31, 38, 135, 0.04);
}

/* ===== Glass Card Hover ===== */
.glass-card-hover {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.08),
        0 2px 8px 0 rgba(31, 38, 135, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card-hover:hover {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.95);
    transform: translateY(-4px);
    box-shadow: 
        0 16px 48px 0 rgba(31, 38, 135, 0.12),
        0 4px 16px 0 rgba(31, 38, 135, 0.08);
}

/* ===== Glass Navigation ===== */
.glass-nav {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 16px 0 rgba(31, 38, 135, 0.06);
}

/* ===== Glass Input ===== */
.glass-input {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(31, 38, 135, 0.12);
    color: #374151;
    transition: all 0.2s ease;
}

.glass-input::placeholder {
    color: rgba(55, 65, 81, 0.5);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.3);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ===== Glass Button - Primary ===== */
.glass-button-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(79, 70, 229, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.glass-button-primary:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(79, 70, 229, 1) 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px 0 rgba(99, 102, 241, 0.3);
}

.glass-button-primary:active {
    transform: translateY(0);
}

/* ===== Glass Button - Secondary ===== */
.glass-button {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(31, 38, 135, 0.12);
    color: #4B5563;
    transition: all 0.3s ease;
    cursor: pointer;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(31, 38, 135, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgba(31, 38, 135, 0.1);
}

.glass-button:active {
    transform: translateY(0);
}

/* ===== Glass Modal/Dialog ===== */
.glass-modal {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 20px 60px 0 rgba(31, 38, 135, 0.15),
        0 8px 24px 0 rgba(31, 38, 135, 0.1);
}

/* ===== Glass Modal Backdrop ===== */
.glass-backdrop {
    background: rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* ===== Shimmer Effect ===== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== Glass Badge ===== */
.glass-badge {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* ===== Icon Background Gradients ===== */
.icon-bg-blue {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.icon-bg-green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.icon-bg-yellow {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.icon-bg-purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.icon-bg-red {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.icon-bg-indigo {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ===== Glass Tab ===== */
.glass-tab {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(31, 38, 135, 0.1);
    color: #6B7280;
    transition: all 0.2s ease;
    cursor: pointer;
}

.glass-tab:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #374151;
}

.glass-tab.active {
    background: rgba(99, 102, 241, 0.9);
    border: 1px solid rgba(99, 102, 241, 1);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ===== Glass Tree Item ===== */
.glass-tree-item {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    cursor: pointer;
}

.glass-tree-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(2px);
}

.glass-tree-item.active {
    background: rgba(255, 255, 255, 0.9);
    border-left: 4px solid #6366F1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* ===== Status Badge Colors ===== */
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #2563EB;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ===== Notification Badge ===== */
.notification-badge {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .glass-card,
    .glass-card-hover {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    .glass-nav {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* ============================================
   Mobile-First Responsive Design
   ============================================ */

/* ===== Hide Desktop Navigation on Mobile ===== */
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }
    
    /* Show Mobile Bottom Tab Bar */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border-top: 1px solid rgba(31, 38, 135, 0.12);
        box-shadow: 0 -4px 16px 0 rgba(31, 38, 135, 0.08);
        z-index: 100;
        padding: 0.5rem 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile Tab Item */
    .mobile-tab-item {
        flex: 0 0 auto;
        min-width: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.5rem 0.75rem;
        cursor: pointer;
        transition: all 0.2s ease;
        color: #9CA3AF;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .mobile-tab-item i {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .mobile-tab-item.active {
        color: #6366F1;
    }
    
    .mobile-tab-item:active {
        transform: scale(0.95);
    }
    
    /* Mobile Content Padding (for bottom nav) */
    .mobile-content {
        padding-bottom: 70px !important;
    }
    
    /* Mobile Header */
    .mobile-header {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border-bottom: 1px solid rgba(31, 38, 135, 0.12);
        box-shadow: 0 2px 16px 0 rgba(31, 38, 135, 0.06);
        position: sticky;
        top: 0;
        z-index: 50;
        padding: 1rem;
    }
    
    /* Mobile Card Adjustments */
    .glass-card {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Mobile Button Sizes (Touch-Friendly) */
    .glass-button,
    .glass-button-primary {
        min-height: 44px; /* iOS Human Interface Guidelines */
        padding: 0.75rem 1rem !important;
        font-size: 1rem;
    }
    
    /* Mobile Font Sizes */
    body {
        font-size: 16px; /* Prevent iOS auto-zoom */
    }
    
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }
    h3 { font-size: 1.125rem !important; }
    
    /* Mobile Modal Adjustments */
    .glass-modal {
        max-width: 95vw !important;
        max-height: 85vh !important;
        overflow-y: auto;
        margin: 1rem !important;
    }
    
    /* Mobile Input Adjustments */
    .glass-input {
        min-height: 44px;
        font-size: 16px; /* Prevent iOS auto-zoom */
    }
    
    /* Hide Matrix View on Mobile (Too Complex) */
    #todo-matrix-view {
        display: none !important;
    }
    
    /* Force List View on Mobile */
    #todos-list {
        display: block !important;
    }
    
    /* Hide View Toggle on Mobile */
    .view-toggle-mobile-hide {
        display: none !important;
    }
    
    /* Mobile Markdown Content */
    .markdown-content {
        font-size: 0.875rem;
        line-height: 1.6;
    }
    
    .markdown-content h1 { font-size: 1.25rem !important; }
    .markdown-content h2 { font-size: 1.125rem !important; }
    .markdown-content h3 { font-size: 1rem !important; }
    
    /* Mobile Table Scroll */
    .markdown-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile Badge Sizes */
    .badge {
        font-size: 0.625rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Mobile User Profile */
    .user-profile {
        flex-shrink: 0;
    }
    
    /* Mobile Search Results */
    #search-results {
        max-width: 95vw !important;
        left: 2.5vw !important;
        right: 2.5vw !important;
    }
    
    /* Mobile Tree View (Sidebar) */
    .glass-tree-item {
        padding: 0.75rem !important;
        font-size: 0.875rem;
    }
    
    /* Mobile Scrollbar Hide */
    .mobile-bottom-nav::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-bottom-nav {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ===== Desktop Only (Hide Mobile Nav) ===== */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .desktop-nav {
        display: flex !important;
    }
    
    /* Show view toggle on desktop */
    .view-toggle-mobile-hide {
        display: flex !important;
    }
}

/* ===== Text Colors (for readability on light background) ===== */
.text-primary {
    color: #111827;
}

.text-secondary {
    color: #6B7280;
}

.text-tertiary {
    color: #9CA3AF;
}

/* ===== Loading Spinner (Glass Style) ===== */
.glass-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid rgba(99, 102, 241, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Scrollbar Styling (optional) ===== */
.glass-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.glass-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.glass-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 4px;
}

.glass-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* ===== Diff Highlighting Styles ===== */

/* Diff Container */
.diff-container {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    line-height: 1.8;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Diff Mode Toggle */
.diff-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.diff-mode-toggle button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.7);
    color: #4F46E5;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.diff-mode-toggle button:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
}

.diff-mode-toggle button.active {
    background: #4F46E5;
    color: white;
    border-color: #4F46E5;
}

/* Unified Diff (Inline) */
.diff-deleted {
    background-color: #ffd7d5;
    color: #c93026;
    text-decoration: line-through;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.diff-added {
    background-color: #d1f0d1;
    color: #28a745;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.diff-modified {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Diff with Icon */
.diff-deleted::before {
    content: '−';
    margin-right: 4px;
    font-weight: bold;
}

.diff-added::before {
    content: '+';
    margin-right: 4px;
    font-weight: bold;
}

/* Split View */
.diff-split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.diff-column {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    overflow: hidden;
}

.diff-column-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.diff-column-header.old {
    background: rgba(255, 215, 213, 0.5);
    color: #c93026;
}

.diff-column-header.new {
    background: rgba(209, 240, 209, 0.5);
    color: #28a745;
}

.diff-column-content {
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.diff-line {
    display: flex;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 2px;
}

.diff-line.unchanged {
    background: transparent;
}

.diff-line.deleted {
    background: rgba(255, 215, 213, 0.3);
}

.diff-line.added {
    background: rgba(209, 240, 209, 0.3);
}

.diff-line-number {
    display: inline-block;
    width: 40px;
    text-align: right;
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.75rem;
    user-select: none;
    margin-right: 1rem;
}

.diff-line-content {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Change Statistics */
.diff-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.diff-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diff-stat-item.added {
    color: #28a745;
}

.diff-stat-item.deleted {
    color: #c93026;
}

.diff-stat-item.modified {
    color: #856404;
}

.diff-stat-icon {
    font-weight: bold;
    font-size: 1rem;
}

/* Diff Legend */
.diff-legend {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.diff-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diff-legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: inline-block;
}

.diff-legend-icon.added {
    background: #d1f0d1;
    border: 1px solid #28a745;
}

.diff-legend-icon.deleted {
    background: #ffd7d5;
    border: 1px solid #c93026;
}

.diff-legend-icon.modified {
    background: #fff3cd;
    border: 1px solid #856404;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .diff-split-view {
        grid-template-columns: 1fr;
    }
    
    .diff-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .diff-legend {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ============================================
   Wiki Link Styles (Obsidian-style)
   ============================================ */

/* Wiki link styling - similar to Obsidian */
.wiki-link {
    color: #6366f1;
    text-decoration: none;
    border-bottom: 1px dashed #6366f1;
    padding: 0 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.wiki-link:hover {
    background: rgba(99, 102, 241, 0.1);
    border-bottom-style: solid;
    border-radius: 2px;
}

.wiki-link:active {
    background: rgba(99, 102, 241, 0.2);
}

/* Backlinks section styling */
.backlinks-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.backlink-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.backlink-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.backlink-context {
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 0.25rem;
    opacity: 0.8;
}

