/* Tech Searchers PC Builder - Modern Styling */
#tech-searchers-pc-builder {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 20px;
}

/* Header */
.ts-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.ts-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.ts-header p {
    margin: 0 0 20px 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.ts-total-price {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-block;
    backdrop-filter: blur(10px);
}

/* Components Grid */
.ts-components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ts-component-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.ts-component-card:hover {
    border-color: #3b82f6;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15);
}

.ts-component-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.ts-component-card h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 1.3rem;
}

.ts-component-status {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 15px;
    min-height: 20px;
}

.ts-select-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
}

.ts-select-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* Selected Product */
.ts-selected-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 8px;
    margin-top: 15px;
}

.ts-selected-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 5px;
}

.ts-selected-details {
    flex: 1;
    text-align: left;
}

.ts-selected-details strong {
    display: block;
    font-size: 0.9rem;
    color: #1f2937;
    margin-bottom: 4px;
}

.ts-selected-price {
    color: #059669;
    font-weight: bold;
    font-size: 0.9rem;
}

.ts-product-remove {
    background: #ef4444;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s ease;
}

.ts-product-remove:hover {
    background: #dc2626;
}

/* Build Summary */
.ts-build-summary {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.ts-build-summary h3 {
    margin: 0 0 20px 0;
    color: #1f2937;
    font-size: 1.5rem;
}

.ts-no-components {
    color: #6b7280;
    font-style: italic;
    text-align: center;
    padding: 30px;
}

.ts-build-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ts-build-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.ts-build-component {
    font-weight: 600;
    color: #374151;
}

.ts-build-product {
    flex: 1;
    margin: 0 15px;
    color: #6b7280;
    font-size: 0.9rem;
}

.ts-build-price {
    color: #059669;
    font-weight: bold;
}

.ts-build-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.ts-clear-btn, .ts-share-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
}

.ts-clear-btn {
    background: #6b7280;
    color: white;
}

.ts-clear-btn:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.ts-share-btn {
    background: #059669;
    color: white;
}

.ts-share-btn:hover {
    background: #047857;
    transform: translateY(-2px);
}

/* Modal */
.ts-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.ts-modal-content {
    background: white;
    margin: 2% auto;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.ts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.ts-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
}

.ts-close-modal {
    font-size: 2rem;
    cursor: pointer;
    color: white;
    transition: color 0.2s ease;
    line-height: 1;
}

.ts-close-modal:hover {
    color: #fbbf24;
}

.ts-modal-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

/* Search Controls */
.ts-search-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

#ts-search-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

#ts-search-input:focus {
    outline: none;
    border-color: #f59e0b;
}

.ts-search-button {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ts-search-button:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.ts-search-button:disabled {
    background: #9ca3af;
    transform: none;
    cursor: not-allowed;
}

/* Search Tips */
.ts-search-tips {
    background: #fffbeb;
    border: 2px solid #fef3c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.ts-search-tips h4 {
    margin: 0 0 15px 0;
    color: #92400e;
}

.ts-keyword-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ts-keyword {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #f59e0b;
}

.ts-keyword:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-1px);
}

/* Search Results */
.ts-search-results {
    min-height: 300px;
}

.ts-welcome-message, .ts-search-message {
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 15px;
}

.ts-welcome-message {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    color: #0369a1;
}

.ts-loading-message {
    background: #eff6ff;
    border: 2px solid #dbeafe;
    color: #1e40af;
}

.ts-error-message {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.ts-info-message {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    color: #0369a1;
}

.ts-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #1f2937;
    color: white;
    border-radius: 8px;
}

.ts-results-header h4 {
    margin: 0;
}

.ts-view-all {
    color: #fbbf24;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border: 2px solid #fbbf24;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ts-view-all:hover {
    background: #fbbf24;
    color: #1f2937;
}

/* Products Grid */
.ts-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ts-product-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s ease;
}

.ts-product-card:hover {
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.1);
}

.ts-product-image {
    text-align: center;
    margin-bottom: 15px;
}

.ts-product-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}

.ts-product-info h5 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
}

.ts-product-price {
    color: #059669;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.ts-product-features {
    color: #6b7280;
    font-size: 0.8rem;
    margin-bottom: 15px;
    line-height: 1.3;
    height: 2.4em;
    overflow: hidden;
}

.ts-product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ts-product-select {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.ts-product-select:hover {
    background: #2563eb;
}

.ts-amazon-link {
    color: #f59e0b;
    text-decoration: none;
    font-weight: 600;
    padding: 8px;
    border: 2px solid #f59e0b;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.ts-amazon-link:hover {
    background: #f59e0b;
    color: white;
}

/* Messages */
.ts-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

.ts-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
    color: #065f46;
}

.ts-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    color: #991b1b;
}

.ts-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    color: #1e40af;
}

/* Responsive Design */
@media (max-width: 768px) {
    #tech-searchers-pc-builder {
        padding: 15px;
    }
    
    .ts-components-grid {
        grid-template-columns: 1fr;
    }
    
    .ts-header {
        padding: 20px;
    }
    
    .ts-header h1 {
        font-size: 2rem;
    }
    
    .ts-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .ts-search-controls {
        flex-direction: column;
    }
    
    .ts-products-grid {
        grid-template-columns: 1fr;
    }
    
    .ts-build-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .ts-build-actions {
        flex-direction: column;
    }
    
    .ts-results-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}