/* Model Comparison Tool Styles */

.model-comparison-tool {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tool-header p {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

.tool-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Specs Panel */
.specs-panel {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    position: sticky;
    top: 2rem;
}

.specs-panel h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.specs-form {
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    color: #495057;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.find-models-btn, .reset-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-height: 44px;
}

.find-models-btn {
    background: #3498db;
    color: white;
}

.find-models-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.reset-btn {
    background: #6c757d;
    color: white;
}

.reset-btn:hover {
    background: #5a6268;
}

/* Search Section */
.search-section {
    margin-bottom: 1.5rem;
}

.search-section h4 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    color: #495057;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-clear-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.search-clear-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Quick Filters */
.quick-filters {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.quick-filters h4 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    padding: 0.4rem 0.8rem;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
}

.filter-tag:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Results Panel */
.results-panel {
    min-height: 600px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.results-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.results-count {
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

/* Loading and Error States */
.loading-indicator {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-bottom: 1rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-results h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Model Card */
.model-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.model-card.recommended {
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.recommended-badge {
    position: absolute;
    top: -8px;
    right: 1rem;
    background: #28a745;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.model-header {
    margin-bottom: 1rem;
}

.model-name {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.model-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-size {
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.model-difficulty {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
}

.difficulty-beginner {
    background: #d4edda;
    color: #155724;
}

.difficulty-intermediate {
    background: #fff3cd;
    color: #856404;
}

.difficulty-advanced {
    background: #f8d7da;
    color: #721c24;
}

.model-description {
    margin-bottom: 1rem;
}

.model-description p {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
}

/* Model Specifications */
.model-specs {
    margin-bottom: 1rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.spec-item:last-child {
    margin-bottom: 0;
}

.spec-label {
    font-weight: 500;
    color: #495057;
}

.spec-value {
    color: #6c757d;
    text-align: right;
}

.ram-optimal {
    color: #28a745;
    font-weight: 500;
}

.ram-minimum {
    color: #ffc107;
    font-weight: 500;
}

.ram-insufficient {
    color: #dc3545;
    font-weight: 500;
}

/* Use Cases */
.model-use-cases {
    margin-bottom: 1rem;
}

.use-cases-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    display: block;
    margin-bottom: 0.5rem;
}

.use-cases-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.use-case-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Compatibility */
.model-compatibility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.compatibility-icons {
    display: flex;
    gap: 0.5rem;
}

.os-icon, .arch-icon {
    font-size: 1.2rem;
    cursor: help;
}

.gpu-requirement {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

/* Model Actions */
.model-actions {
    display: flex;
    gap: 0.5rem;
}

.download-btn, .info-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.info-btn {
    background: #6c757d;
    color: white;
}

.info-btn:hover {
    background: #5a6268;
}

.btn-icon {
    font-size: 1em;
}

/* Model Details */
.model-details {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.model-details h5 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.model-details ol, .model-details ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.model-details li {
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.model-details code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #e83e8c;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tool-content {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }
    
    .models-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .model-comparison-tool {
        padding: 1rem;
    }
    
    .tool-header h2 {
        font-size: 1.5rem;
    }
    
    .tool-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .specs-panel {
        position: static;
        order: 2;
    }
    
    .results-panel {
        order: 1;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .models-grid {
        grid-template-columns: 1fr;
    }
    
    .model-actions {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .model-comparison-tool {
        padding: 0.5rem;
    }
    
    .tool-header {
        margin-bottom: 1rem;
    }
    
    .tool-header h2 {
        font-size: 1.3rem;
    }
    
    .tool-header p {
        font-size: 1rem;
    }
    
    .specs-panel {
        padding: 1rem;
    }
    
    .model-card {
        padding: 1rem;
    }
    
    .model-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .model-compatibility {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .filter-tags {
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .specs-panel {
        display: none;
    }
    
    .model-comparison-tool {
        box-shadow: none;
    }
    
    .model-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .download-btn, .info-btn {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .model-card {
        border: 2px solid #000;
    }
    
    .model-card.recommended {
        border-color: #000;
        background: #f0f0f0;
    }
    
    .filter-tag:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .model-card,
    .download-btn,
    .info-btn,
    .filter-tag,
    .find-models-btn,
    .reset-btn {
        transition: none;
    }
    
    .model-card:hover {
        transform: none;
    }
    
    .spinner {
        animation: none;
    }
}
/
* Site-wide Search Styles */

/* Search Trigger Button */
.search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-height: 44px;
}

.search-trigger:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.search-trigger:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.search-icon {
    font-size: 1.1em;
}

.search-shortcut {
    font-size: 0.8em;
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #6c757d;
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal.active {
    display: flex;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.search-modal-header h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.search-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

/* Search Input */
.search-input-container {
    position: relative;
    padding: 1rem 1.5rem 0;
}

.site-search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.1rem;
    background: white;
    color: #495057;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.site-search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Search Results */
.search-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 1rem;
}

.search-results-header {
    padding: 1rem 0 0.5rem;
    border-bottom: 1px solid #f8f9fa;
    margin-bottom: 0.5rem;
}

.search-results-count {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-item {
    padding: 1rem;
    border: 1px solid #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.search-result-item:hover,
.search-result-item.selected {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.search-result-title {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

.search-result-title mark {
    background: #fff3cd;
    color: #856404;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.search-result-type {
    font-size: 0.8rem;
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: 1rem;
}

.search-result-content {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

.search-result-content mark {
    background: #fff3cd;
    color: #856404;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.search-result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-url {
    font-size: 0.8rem;
    color: #28a745;
    font-family: monospace;
}

/* Search Modal Footer */
.search-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.search-shortcuts {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.search-shortcuts kbd {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
    border: 1px solid #ced4da;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Loading and Empty States */
.search-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

.no-search-results {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.no-search-results h3 {
    font-size: 1.1rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Body class when search modal is open */
.search-modal-open {
    overflow: hidden;
}

/* Responsive Design for Search */
@media (max-width: 768px) {
    .search-trigger .search-text {
        display: none;
    }
    
    .search-trigger .search-shortcut {
        display: none;
    }
    
    .search-modal {
        padding-top: 5vh;
    }
    
    .search-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .search-modal-header,
    .search-input-container,
    .search-results-container,
    .search-modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .site-search-input {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .search-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .search-result-type {
        margin-left: 0;
    }
    
    .search-shortcuts {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .search-modal {
        padding-top: 2vh;
    }
    
    .search-modal-content {
        width: 98%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .search-result-item {
        padding: 0.75rem;
    }
    
    .search-shortcuts {
        justify-content: center;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .search-modal-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .search-result-item {
        border: 2px solid #000;
    }
    
    .search-result-item.selected {
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .search-result-item,
    .search-trigger,
    .search-modal-close {
        transition: none;
    }
    
    .search-result-item:hover,
    .search-result-item.selected {
        transform: none;
    }
}