/**
 * Özdemir Makine - User Experience CSS
 * Lightbox, Recently Viewed, Advanced Search, Print Styles
 */

/* ==========================================
   1. LIGHTBOX GALERİ
   ========================================== */
.lightbox-gallery {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox-gallery.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-container {
    position: relative;
    width: 95vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s;
}

.lightbox-loader {
    position: absolute;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-400);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: var(--primary-500);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    color: white;
}

.lightbox-counter {
    font-size: 0.875rem;
    opacity: 0.7;
}

.lightbox-caption {
    font-size: 1rem;
    font-weight: 500;
    max-width: 500px;
    text-align: center;
}

.lightbox-actions {
    display: flex;
    gap: 0.5rem;
}

.lightbox-action-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.lightbox-action-btn:hover {
    background: var(--primary-500);
}

.lightbox-thumbnails {
    display: none;
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 90%;
    overflow-x: auto;
    padding: 0.5rem;
}

.lightbox-thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.lightbox-thumb:hover,
.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--primary-500);
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================
   2. SON GÖRÜNTÜLENENLER
   ========================================== */
.recently-viewed-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    margin: var(--space-6) 0;
}

.recently-viewed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}

.recently-viewed-header h4 {
    font-size: var(--text-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-primary);
}

.recently-viewed-header h4 i {
    color: var(--primary-500);
}

.btn-clear-recent {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-recent:hover {
    background: var(--error-50);
    color: var(--error);
    border-color: var(--error-200);
}

.recently-viewed-list {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
}

.recently-viewed-item {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    text-decoration: none;
    transition: all 0.2s;
}

.recently-viewed-item:hover {
    transform: translateY(-2px);
}

.recent-image {
    width: 120px;
    height: 90px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
}

.recent-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-info {
    margin-top: var(--space-2);
}

.recent-title {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.recent-brand {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Sidebar Widget */
.recently-viewed-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    margin-top: var(--space-4);
}

.recently-viewed-sidebar h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.recent-items-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.recent-item-sidebar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
}

.recent-item-sidebar:hover {
    background: var(--bg-secondary);
}

.recent-item-sidebar img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.recent-item-info {
    flex: 1;
    min-width: 0;
}

.recent-item-title {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item-price {
    display: block;
    font-size: var(--text-xs);
    color: var(--primary-600);
    font-weight: 500;
}

/* ==========================================
   3. GELİŞMİŞ ARAMA (AUTOCOMPLETE)
   ========================================== */
.search-autocomplete {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-height: 70vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.search-autocomplete.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.autocomplete-results {
    padding: var(--space-3);
}

.autocomplete-section {
    margin-bottom: var(--space-3);
}

.autocomplete-section:last-child {
    margin-bottom: 0;
}

.section-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-2);
    margin-bottom: var(--space-1);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--primary-50);
}

.autocomplete-item.simple {
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
}

.autocomplete-item.simple i {
    color: var(--text-muted);
    width: 16px;
}

.item-image {
    width: 50px;
    height: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-title {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-title mark {
    background: var(--primary-200);
    color: var(--primary-800);
    padding: 0 2px;
    border-radius: 2px;
}

.item-meta {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.item-badge {
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.item-badge.badge-new {
    background: var(--success-100);
    color: var(--success-700);
}

.item-badge.badge-used {
    background: var(--warning-100);
    color: var(--warning-700);
}

.autocomplete-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6);
    color: var(--text-muted);
}

.autocomplete-empty i {
    font-size: 2rem;
    opacity: 0.3;
}

.autocomplete-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border-top: 1px solid var(--border-light);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--primary-600);
    text-decoration: none;
    transition: all 0.2s;
}

.autocomplete-view-all:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.autocomplete-footer {
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.autocomplete-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ==========================================
   4. YAZDIRMA STİLLERİ
   ========================================== */
@media print {
    /* Gizlenecek elemanlar */
    .header,
    .top-bar,
    .footer,
    .floating-actions,
    .cookie-consent,
    .compare-bar,
    .toast-container,
    .search-overlay,
    .nav-actions,
    .action-buttons-row,
    .contact-box,
    .similar-section,
    .lightbox-gallery,
    #chatbotWidget,
    .price-calculator,
    .social-proof-popup,
    .urgency-banner,
    .scroll-progress,
    .cursor-trail,
    .floating-shapes-container,
    #particlesCanvas {
        display: none !important;
    }

    /* Genel ayarlar */
    body {
        background: white !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Makine detay sayfası */
    .machine-detail-grid {
        display: block !important;
    }

    .machine-gallery {
        page-break-inside: avoid;
        margin-bottom: 20pt;
    }

    .main-image-container {
        max-height: 300pt !important;
    }

    .thumbnail-strip {
        display: none !important;
    }

    .machine-info {
        page-break-inside: avoid;
    }

    .machine-title {
        font-size: 18pt !important;
        color: #000 !important;
    }

    .machine-price-wrap {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .specs-section,
    .description-section {
        page-break-inside: avoid;
        margin-top: 15pt;
    }

    .specs-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .spec-item {
        border: 1px solid #ddd !important;
        padding: 8pt !important;
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Linkler */
    a {
        color: #000 !important;
        text-decoration: none !important;
    }

    a[href]::after {
        content: none !important;
    }

    /* Butonlar */
    .btn {
        display: none !important;
    }

    /* Sayfa sonları */
    h1, h2, h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* Footer bilgisi */
    @page {
        margin: 2cm;
    }

    /* Yazdırma başlığı */
    .print-header {
        display: block !important;
        text-align: center;
        padding-bottom: 15pt;
        border-bottom: 2pt solid #00b4b4;
        margin-bottom: 15pt;
    }

    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 10pt;
        color: #666;
        border-top: 1pt solid #ddd;
        padding-top: 10pt;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 45px;
        height: 45px;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }

    .lightbox-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .recently-viewed-list {
        flex-wrap: nowrap;
    }

    .search-autocomplete {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 60vh;
    }
}

