/*
 * PC Builder Frontend CSS (Sürüm 3.0 - Profesyonel Tasarım)
 * Açıklama: Daha modern ve kullanıcı dostu bir arayüz için tamamen yeniden tasarlandı.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Renk Paleti */
    --pcb-color-primary: #4f46e5; /* Indigo 600 */
    --pcb-color-primary-dark: #4338ca; /* Indigo 700 */
    --pcb-color-primary-light: #eef2ff; /* Indigo 50 */
    --pcb-color-secondary: #6b7280; /* Gray 500 */
    --pcb-color-success: #16a34a; /* Green 600 */
    --pcb-color-danger: #dc2626; /* Red 600 */
    --pcb-bg-main: #f9fafb; /* Gray 50 */
    --pcb-bg-card: #ffffff;
    --pcb-border-color: #e5e7eb; /* Gray 200 */
    --pcb-text-dark: #111827; /* Gray 900 */
    --pcb-text-light: #4b5563; /* Gray 600 */
    
    /* Gölgeler ve Köşeler */
    --pcb-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --pcb-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --pcb-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --pcb-border-radius: 0.75rem; /* 12px */
    --pcb-modal-overlay-bg: rgba(17, 24, 39, 0.7);
    --pcb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Genel Konteyner ve Tipografi --- */
.pc-builder-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--pcb-bg-main);
    padding: 1.5rem;
}

@media (min-width: 1024px) {
    .pc-builder-container {
        grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.5fr);
    }
}

.builder-header {
    margin-bottom: 1rem;
}
.builder-header h1 {
    font-size: 2.25rem; /* 36px */
    font-weight: 700;
    color: var(--pcb-text-dark);
    margin: 0;
}
.builder-header p {
    font-size: 1.125rem; /* 18px */
    color: var(--pcb-text-light);
    margin-top: 0.5rem;
}

/* --- Kategori Kartları (Yeniden Tasarlandı) --- */
.categories-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-card {
    background: var(--pcb-bg-card);
    border: 1px solid var(--pcb-border-color);
    border-radius: var(--pcb-border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--pcb-transition);
    box-shadow: var(--pcb-shadow-sm);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pcb-shadow-lg);
    border-color: var(--pcb-color-primary);
}

.category-card.is-selected {
    box-shadow: 0 0 0 2px var(--pcb-color-primary);
}

.category-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-icon {
    font-size: 1.75rem; /* 28px */
    color: var(--pcb-color-primary);
    background-color: var(--pcb-color-primary-light);
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-details h3 {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    margin: 0;
    color: var(--pcb-text-dark);
}

.category-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--pcb-bg-main);
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 70px;
}

.selected-component-preview {
    font-size: 0.9rem;
    color: var(--pcb-text-light);
    flex-grow: 1;
}
.selected-component-preview strong {
    color: var(--pcb-text-dark);
    font-weight: 500;
}

.category-price {
    font-weight: 600;
    font-size: 1rem;
    color: var(--pcb-color-primary);
    margin-left: 1rem;
}

.category-actions {
    flex-shrink: 0;
    margin-left: 1rem;
}

/* --- Kenar Çubuğu (Sidebar) ve Özet --- */
.builder-sidebar { position: sticky; top: 1.5rem; }
.summary-box {
    background: var(--pcb-bg-card);
    border-radius: var(--pcb-border-radius);
    padding: 1.5rem;
    border: 1px solid var(--pcb-border-color);
    box-shadow: var(--pcb-shadow-sm);
}
.summary-box h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.summary-placeholder {
    color: var(--pcb-text-light);
    text-align: center;
    padding: 2rem 1rem;
    border: 2px dashed var(--pcb-border-color);
    border-radius: 0.5rem;
}

#summary-items .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pcb-border-color);
    font-size: 0.9rem;
}
#summary-items .summary-item:last-child { border-bottom: none; }
.summary-item-name { font-weight: 600; color: var(--pcb-text-dark); flex-basis: 100px; flex-shrink: 0; }
.summary-item-title { color: var(--pcb-text-light); text-align: left; flex-grow: 1; }
.summary-item-price { font-weight: 500; text-align: right; margin-left: 1rem; }

.summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pcb-text-dark);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--pcb-border-color);
}

#compatibility-warnings { margin-top: 1rem; }
.warning-message { padding: 0.75rem 1.25rem; border-radius: 0.5rem; font-size: 0.9rem; border: 1px solid transparent; }
.warning-message.error { background-color: #fee2e2; color: #991b1b; border-color: #fecaca; }
.warning-message.success { background-color: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* --- Butonlar --- */
.pcb-button-primary, .pcb-button-secondary, .pcb-add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: var(--pcb-transition);
    text-decoration: none;
}
.pcb-button-primary { background-color: var(--pcb-color-primary); color: #fff; }
.pcb-button-primary:hover { background-color: var(--pcb-color-primary-dark); transform: translateY(-2px); }
.pcb-button-secondary { background-color: var(--pcb-bg-card); color: var(--pcb-text-light); border-color: var(--pcb-border-color); }
.pcb-button-secondary:hover { border-color: var(--pcb-color-secondary); color: var(--pcb-text-dark); }
.pcb-add-to-cart-btn { width: 100%; background-color: var(--pcb-color-success); color: #fff; font-size: 1.1rem; margin-top: 1rem; }
.pcb-add-to-cart-btn:hover { background-color: #15803d; }
.pcb-add-to-cart-btn:disabled { background-color: var(--pcb-color-secondary); cursor: not-allowed; opacity: 0.7; }
.clear-btn { width: 100%; margin-top: 0.5rem; }

/* --- Modal --- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--pcb-modal-overlay-bg);
    backdrop-filter: blur(4px);
    padding: 1rem;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.is-visible { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--pcb-bg-card);
    border-radius: var(--pcb-border-radius);
    width: 100%; max-width: 800px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: var(--pcb-shadow-lg);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.is-visible .modal-content { transform: scale(1); }

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--pcb-border-color); }
.modal-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.modal-close-button { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--pcb-text-light); }
.modal-search { padding: 1rem 1.5rem; position: relative; }
.modal-search input { width: 100%; border: 1px solid var(--pcb-border-color); padding: 0.75rem 0.75rem 0.75rem 2.5rem; border-radius: 0.5rem; background-color: var(--pcb-bg-main); }
.modal-search .eicon-search { position: absolute; top: 50%; transform: translateY(-50%); left: 2rem; font-size: 1.2rem; color: var(--pcb-text-light); }

.modal-body { overflow-y: auto; padding: 0.5rem; flex-grow: 1; }
.loader-wrapper { text-align: center; padding: 3rem; }
.loader { border: 5px solid var(--pcb-border-color); border-top: 5px solid var(--pcb-color-primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.component-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--pcb-border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.component-item:hover { background-color: var(--pcb-color-primary-light); }
.component-item:last-child { border-bottom: none; }
.component-image { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.component-info { flex-grow: 1; }
.component-title { font-weight: 600; color: var(--pcb-text-dark); }
.component-brand { font-size: 0.875rem; color: var(--pcb-text-light); }
.component-price { font-size: 1.125rem; font-weight: 600; color: var(--pcb-color-primary); text-align: right; }
.modal-no-results { text-align: center; padding: 2rem; color: var(--pcb-text-light); }

/* Stok Durumu Stilleri */
.component-item.out-of-stock {
    cursor: not-allowed;
    filter: grayscale(80%);
    opacity: 0.7;
}
.component-item.out-of-stock:hover { background-color: transparent; }
.stock-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}
.out-of-stock-badge {
    color: #fff;
    background-color: var(--pcb-color-danger);
}
