/**
 * PC Builder Styles
 * Dark theme with purple-pink-blue gradient
 */

:root {
    --pcb-gradient-start: #1a1464;
    --pcb-gradient-mid: #8b1c8e;
    --pcb-gradient-end: #e91e63;
    --pcb-dark-bg: #0a0d1f;
    --pcb-card-bg: rgba(26, 20, 100, 0.3);
    --pcb-card-border: rgba(139, 28, 142, 0.4);
    --pcb-accent: #e91e63;
    --pcb-accent-secondary: #8b1c8e;
    --pcb-text-primary: #ffffff;
    --pcb-text-secondary: #b8b8d4;
    --pcb-success: #4caf50;
    --pcb-warning: #ff9800;
    --pcb-error: #f44336;
}

/* Global Wrapper */
.pcb-wrapper {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, 
        var(--pcb-gradient-start) 0%, 
        var(--pcb-gradient-mid) 50%, 
        var(--pcb-gradient-end) 100%);
    background-attachment: fixed;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}

.pcb-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 28, 142, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(233, 30, 99, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.pcb-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.pcb-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.6s ease-out;
}

.pcb-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--pcb-text-primary);
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(233, 30, 99, 0.6);
}

.pcb-title i {
    color: var(--pcb-accent);
    margin-right: 15px;
}

.pcb-subtitle {
    font-size: 1.2rem;
    color: var(--pcb-text-secondary);
    font-weight: 300;
}

/* Progress Section */
.pcb-progress-section {
    background: var(--pcb-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--pcb-card-border);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.pcb-progress-section h3 {
    color: var(--pcb-text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.pcb-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.pcb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pcb-accent-secondary), var(--pcb-accent));
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.pcb-progress-icons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.pcb-progress-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pcb-text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.pcb-progress-icon.completed {
    background: linear-gradient(135deg, var(--pcb-accent-secondary), var(--pcb-accent));
    border-color: var(--pcb-accent);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.4);
}

/* Main Content */
.pcb-main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

/* Components Column */
.pcb-components-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pcb-component-section {
    background: var(--pcb-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--pcb-card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.pcb-component-section:hover {
    border-color: var(--pcb-accent);
    box-shadow: 0 8px 30px rgba(233, 30, 99, 0.3);
    transform: translateY(-2px);
}

.pcb-component-section.selected {
    border-color: var(--pcb-accent);
    background: rgba(233, 30, 99, 0.1);
}

.pcb-component-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    user-select: none;
}

.pcb-component-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--pcb-accent-secondary), var(--pcb-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.pcb-component-info {
    flex: 1;
}

.pcb-component-info h3 {
    color: var(--pcb-text-primary);
    font-size: 1.2rem;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.pcb-required-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 152, 0, 0.2);
    color: var(--pcb-warning);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.pcb-component-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--pcb-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pcb-component-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--pcb-accent);
}

.pcb-component-toggle i {
    transition: transform 0.3s ease;
}

.pcb-component-section.expanded .pcb-component-toggle i {
    transform: rotate(180deg);
}

.pcb-component-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.pcb-component-section.expanded .pcb-component-body {
    max-height: 500px;
    padding: 0 20px 20px;
}

/* Selected Product */
.pcb-selected-product {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pcb-selected-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.pcb-selected-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.pcb-selected-details h4 {
    color: var(--pcb-text-primary);
    font-size: 1rem;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.pcb-selected-price {
    color: var(--pcb-success);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 700;
}

.pcb-remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid var(--pcb-error);
    color: var(--pcb-error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pcb-remove-btn:hover {
    background: var(--pcb-error);
    color: white;
    transform: scale(1.1);
}

.pcb-select-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--pcb-accent-secondary), var(--pcb-accent));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.pcb-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(233, 30, 99, 0.5);
}

/* Sidebar */
.pcb-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pcb-summary-card,
.pcb-compatibility-card,
.pcb-templates-card {
    background: var(--pcb-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--pcb-card-border);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.pcb-summary-card h3,
.pcb-compatibility-card h3,
.pcb-templates-card h3 {
    color: var(--pcb-text-primary);
    font-size: 1.2rem;
    margin: 0 0 20px 0;
    font-weight: 600;
}

.pcb-summary-items {
    min-height: 100px;
    margin-bottom: 20px;
}

.pcb-summary-empty {
    text-align: center;
    color: var(--pcb-text-secondary);
    padding: 40px 20px;
    font-style: italic;
}

.pcb-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pcb-summary-item:last-child {
    border-bottom: none;
}

.pcb-summary-item-name {
    color: var(--pcb-text-secondary);
    font-size: 0.9rem;
}

.pcb-summary-item-price {
    color: var(--pcb-text-primary);
    font-weight: 600;
}

.pcb-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 2px solid var(--pcb-accent);
    margin-top: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pcb-text-primary);
}

.pcb-total-price {
    color: var(--pcb-accent);
    font-size: 1.5rem;
}

.pcb-add-to-cart-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--pcb-accent-secondary), var(--pcb-accent));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pcb-add-to-cart-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(233, 30, 99, 0.6);
}

.pcb-add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Compatibility */
.pcb-compatibility-status {
    min-height: 80px;
}

.pcb-compatibility-waiting,
.pcb-compatibility-success,
.pcb-compatibility-error {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
}

.pcb-compatibility-waiting {
    color: var(--pcb-text-secondary);
}

.pcb-compatibility-waiting i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.pcb-compatibility-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--pcb-success);
    color: var(--pcb-success);
}

.pcb-compatibility-success i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.pcb-compatibility-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--pcb-error);
}

.pcb-compatibility-issue {
    color: var(--pcb-error);
    padding: 10px;
    margin: 5px 0;
    background: rgba(244, 67, 54, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
}

.pcb-compatibility-warning {
    color: var(--pcb-warning);
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 152, 0, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Templates */
.pcb-template-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pcb-template-btn {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--pcb-text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.pcb-template-btn:hover {
    background: rgba(233, 30, 99, 0.2);
    border-color: var(--pcb-accent);
    transform: translateX(5px);
}

/* Modal */
.pcb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.pcb-modal.active {
    display: flex;
}

.pcb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.pcb-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(26, 20, 100, 0.95), rgba(139, 28, 142, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid var(--pcb-card-border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pcb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pcb-modal-title {
    color: var(--pcb-text-primary);
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.pcb-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--pcb-text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcb-modal-close:hover {
    background: var(--pcb-error);
    transform: rotate(90deg);
}

.pcb-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.pcb-products-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--pcb-text-secondary);
}

.pcb-products-loading i {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.pcb-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.pcb-product-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcb-product-card:hover {
    background: rgba(233, 30, 99, 0.1);
    border-color: var(--pcb-accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(233, 30, 99, 0.3);
}

.pcb-product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.05);
}

.pcb-product-name {
    color: var(--pcb-text-primary);
    font-size: 1rem;
    margin: 0 0 10px 0;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pcb-product-price {
    color: var(--pcb-accent);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.pcb-products-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--pcb-text-secondary);
}

.pcb-products-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    opacity: 0.3;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .pcb-main-content {
        grid-template-columns: 1fr;
    }
    
    .pcb-sidebar-column {
        order: -1;
    }
    
    .pcb-progress-icons {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .pcb-title {
        font-size: 2rem;
    }
    
    .pcb-subtitle {
        font-size: 1rem;
    }
    
    .pcb-products-grid {
        grid-template-columns: 1fr;
    }
    
    .pcb-modal-content {
        width: 95%;
        max-height: 95vh;
    }
}
