/* PC Builder Styles */
.pcb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.pcb-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.pcb-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 700;
}

.pcb-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Main Content */
.pcb-main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* Categories */
.pcb-categories {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pcb-category-item {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pcb-category-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.pcb-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.pcb-category-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.2em;
    color: #2d3748;
}

.pcb-icon {
    font-size: 1.5em;
    margin-right: 10px;
}

.pcb-select-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pcb-select-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.pcb-selected-component {
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.pcb-selected-component.has-selection {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.pcb-placeholder {
    color: #a0aec0;
    font-style: italic;
}

.pcb-component-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.pcb-component-details h4 {
    margin: 0 0 5px 0;
    color: #2d3748;
    font-size: 1.1em;
}

.pcb-component-details p {
    margin: 0;
    color: #718096;
    font-size: 0.9em;
}

.pcb-component-price {
    font-weight: 700;
    color: #e53e3e;
    font-size: 1.1em;
}

.pcb-remove-btn {
    background: #fed7d7;
    color: #e53e3e;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.pcb-remove-btn:hover {
    background: #feb2b2;
}

/* Summary */
.pcb-summary {
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.pcb-summary-header h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 1.4em;
    text-align: center;
}

.pcb-total-price {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.pcb-price-label {
    display: block;
    font-size: 1.1em;
    margin-bottom: 8px;
    opacity: 0.9;
}

.pcb-price-value {
    font-size: 2em;
    font-weight: 800;
    display: block;
}

.pcb-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pcb-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.pcb-btn-primary {
    background: #667eea;
    color: white;
}

.pcb-btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pcb-btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.pcb-btn-secondary:hover {
    background: #cbd5e0;
}

.pcb-btn-info {
    background: #3182ce;
    color: white;
}

.pcb-btn-info:hover {
    background: #2c5282;
}

/* Modal */
.pcb-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.pcb-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pcb-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pcb-modal-header h3 {
    margin: 0;
    font-size: 1.4em;
}

.pcb-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.pcb-close:hover {
    opacity: 1;
}

.pcb-modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Search and Filter */
.pcb-search-box {
    margin-bottom: 20px;
}

.pcb-search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.pcb-search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pcb-filter-options {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcb-filter-options label {
    font-weight: 600;
    color: #2d3748;
}

.pcb-filter-options select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
}

/* Components List */
.pcb-components-list {
    display: grid;
    gap: 15px;
}

.pcb-component-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.pcb-component-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.pcb-component-card.selected {
    border-color: #48bb78;
    background: #f0fff4;
}

.pcb-component-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.pcb-component-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #2d3748;
    margin: 0 0 5px 0;
    flex: 1;
}

.pcb-component-brand {
    background: #edf2f7;
    color: #4a5568;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.pcb-component-specs {
    color: #718096;
    margin: 10px 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.pcb-component-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.pcb-component-price {
    font-size: 1.3em;
    font-weight: 800;
    color: #e53e3e;
}

.pcb-select-component-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pcb-select-component-btn:hover {
    background: #38a169;
    transform: scale(1.05);
}

/* Form Groups */
.pcb-form-group {
    margin-bottom: 20px;
}

.pcb-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.pcb-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.pcb-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pcb-highlight {
    color: #e53e3e;
    font-weight: 700;
    font-size: 1.2em;
}

.pcb-modal-actions {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Loading State */
.pcb-loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.pcb-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .pcb-main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pcb-summary {
        position: static;
        order: -1;
    }

    .pcb-modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 90vh;
    }

    .pcb-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pcb-select-btn {
        align-self: flex-end;
    }

    .pcb-header h2 {
        font-size: 2em;
    }
}

/* Utility Classes */
.pcb-text-center { text-align: center; }
.pcb-mb-10 { margin-bottom: 10px; }
.pcb-mb-20 { margin-bottom: 20px; }
.pcb-mt-20 { margin-top: 20px; }

/* Success Messages */
.pcb-success-message {
    background: #c6f6d5;
    color: #22543d;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #48bb78;
}

.pcb-error-message {
    background: #fed7d7;
    color: #742a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #e53e3e;
}
