/* Can I Run This LLM Calculator Styles */

/* Calculator Header */
.calculator-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 3rem 1rem 2rem;
    text-align: center;
}

.calculator-header .container {
    max-width: 800px;
    margin: 0 auto;
}

.calculator-title {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    position: relative;
}

.calculator-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #212529;
    border-radius: 2px;
}

.calculator-description {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    color: #6c757d;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Calculator Section */
.calculator-section {
    padding: 2rem 0;
    background-color: #f8f9fa;
}

.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Stack on mobile */
@media (max-width: 900px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
}

/* Calculator Form */
.calculator-form-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: clamp(1rem, 3vw, 2rem);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Real-time Indicator */
.realtime-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.realtime-indicator i {
    color: #28a745;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.form-group label {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-group label i {
    color: #6c757d;
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Searchable Combobox */
.combobox-wrapper {
    position: relative;
    width: 100%;
}

.combobox-input {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fefefe;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.combobox-input:focus {
    outline: none;
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
    cursor: text;
}

.combobox-input::placeholder {
    color: #6c757d;
}

.combobox-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.combobox-wrapper.open .combobox-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.combobox-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #212529;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.combobox-wrapper.open .combobox-dropdown {
    display: block;
}

.combobox-wrapper.open .combobox-input {
    border-radius: 8px 8px 0 0;
}

.combobox-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.combobox-option:last-child {
    border-bottom: none;
}

.combobox-option:hover,
.combobox-option.highlighted {
    background-color: #f8f9fa;
}

.combobox-option.selected {
    background-color: #e9ecef;
    font-weight: 600;
}

.combobox-option.no-results {
    color: #6c757d;
    font-style: italic;
    cursor: default;
}

.combobox-option.no-results:hover {
    background-color: transparent;
}

/* Checkbox Group */
.checkbox-group {
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #212529;
}

.checkbox-label span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label span i {
    color: #6c757d;
}

.form-group select,
.form-group input[type="number"] {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fefefe;
    width: 100%;
    box-sizing: border-box;
}

.form-group select:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
}

/* GPU Filter Wrapper */
.gpu-filter-wrapper {
    display: flex;
    gap: 0.75rem;
}

.gpu-filter-wrapper select:first-child {
    flex: 0 0 140px;
}

.gpu-filter-wrapper #gpu-select {
    flex: 1;
}

/* GPU Count Input */
.gpu-count-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.gpu-count-wrapper label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.gpu-count-wrapper input[type="number"] {
    width: 60px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.gpu-count-wrapper input[type="number"]:focus {
    outline: none;
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
}

@media (max-width: 480px) {
    .gpu-filter-wrapper {
        flex-direction: column;
    }

    .gpu-filter-wrapper select:first-child {
        flex: none;
        width: 100%;
    }
}

/* Context Slider */
.context-value {
    margin-left: auto;
    font-weight: 700;
    color: #212529;
    background: #e9ecef;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    outline: none;
    margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #212529;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #212529;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c757d;
    /* Offset for slider thumb width (24px / 2 = 12px on each side) */
    padding: 0.25rem 12px 0;
    margin-top: 0.25rem;
}

.slider-labels span {
    text-align: center;
    min-width: 30px;
}

.slider-labels span:first-child {
    text-align: left;
}

.slider-labels span:last-child {
    text-align: right;
}

/* Calculate Button - Secondary style since calculations are real-time */
.btn-calculate {
    background: transparent;
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-calculate:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

.btn-calculate:active {
    background: #e9ecef;
}

/* Hide button on desktop since we have real-time calculation */
@media (min-width: 901px) {
    .btn-calculate {
        display: none;
    }
}

/* Results Section */
.results-wrapper {
    scroll-margin-top: 2rem;
    position: sticky;
    top: 1rem;
    align-self: start;
}

/* Remove sticky on mobile - full width stacked */
@media (max-width: 900px) {
    .results-wrapper {
        position: static;
    }
}

.results-container {
    background: #ffffff;
    border-radius: 12px;
    padding: clamp(1rem, 3vw, 1.5rem);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.results-container h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-container h2 i {
    color: #6c757d;
}

/* Results Placeholder */
.results-placeholder {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #6c757d;
}

.results-placeholder i {
    font-size: 3.5rem;
    color: #dee2e6;
    margin-bottom: 1rem;
    display: block;
}

.results-placeholder p {
    font-size: 1rem;
    margin: 0;
}

/* Fit Status */
.fit-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.fit-status.status-good {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 4px solid #28a745;
}

.fit-status.status-tight {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 4px solid #ffc107;
}

.fit-status.status-bad {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left: 4px solid #dc3545;
}

.status-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.fit-status.status-good .status-icon {
    color: #28a745;
}

.fit-status.status-tight .status-icon {
    color: #856404;
}

.fit-status.status-bad .status-icon {
    color: #dc3545;
}

.status-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.status-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.fit-status.status-good .status-text h3 {
    color: #155724;
}

.fit-status.status-good .status-text p {
    color: #155724;
}

.fit-status.status-tight .status-text h3 {
    color: #856404;
}

.fit-status.status-tight .status-text p {
    color: #856404;
}

.fit-status.status-bad .status-text h3 {
    color: #721c24;
}

.fit-status.status-bad .status-text p {
    color: #721c24;
}

/* VRAM Breakdown */
.vram-breakdown {
    margin-bottom: 1.5rem;
}

.vram-breakdown h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 1rem 0;
}

.vram-bar-container {
    position: relative;
    margin-bottom: 1rem;
}

.vram-bar {
    display: flex;
    height: 32px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.vram-segment {
    height: 100%;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    min-width: 0;
}

.vram-segment.weights {
    background: linear-gradient(135deg, #4a90d9, #357abd);
}

.vram-segment.kv-cache {
    background: linear-gradient(135deg, #50c878, #3cb371);
}

.vram-segment.overhead {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.vram-limit-marker {
    position: absolute;
    top: -8px;
    bottom: -8px;
    width: 3px;
    background: #dc3545;
    border-radius: 2px;
    right: 0;
    z-index: 10;
}

.vram-limit-marker span {
    position: absolute;
    top: -20px;
    right: 0;
    transform: translateX(50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #dc3545;
    white-space: nowrap;
}

/* VRAM Legend */
.vram-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #495057;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-color.weights {
    background: linear-gradient(135deg, #4a90d9, #357abd);
}

.legend-color.kv-cache {
    background: linear-gradient(135deg, #50c878, #3cb371);
}

.legend-color.overhead {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* Overhead Breakdown */
.overhead-breakdown {
    flex-wrap: wrap;
}

.overhead-info {
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    cursor: help;
    position: relative;
    transition: color 0.2s ease;
}

.overhead-info:hover {
    color: #212529;
}

/* Tooltip via title attribute - use native browser tooltip */
.overhead-info[title] {
    text-decoration-style: dotted;
}

.overhead-details {
    width: 100%;
    padding-left: 1.25rem;
    margin-top: 0.25rem;
}

.overhead-details small {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.overhead-details strong {
    color: #495057;
}

/* VRAM Total */
.vram-total {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
}

.vram-total strong {
    font-size: 1.35rem;
    color: #212529;
}

.vram-available {
    color: #6c757d;
}

/* Performance Section */
.performance-section {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 10px;
}

.performance-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.performance-section h4 i {
    color: #6c757d;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.perf-item {
    text-align: center;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.perf-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.perf-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

.perf-note {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

.perf-note i {
    margin-right: 0.25rem;
}

/* How It Works Section */
.how-it-works-section {
    padding: 3rem 1rem;
    background: #ffffff;
}

.how-it-works-section .container {
    max-width: 1100px;
    margin: 0 auto;
}

.how-it-works-section h2 {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #212529;
    margin-bottom: 2rem;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e9ecef;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #212529, #495057);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.card-icon i {
    font-size: 1.5rem;
    color: #ffffff;
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 0.75rem 0;
}

.info-card p {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* Quantization Section */
.quant-section {
    padding: 3rem 1rem;
    background: #f8f9fa;
}

.quant-section .container {
    max-width: 900px;
    margin: 0 auto;
}

.quant-section h2 {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.section-description {
    text-align: center;
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    color: #6c757d;
    margin-bottom: 2rem;
}

.quant-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.quant-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-width: 600px;
}

.quant-table thead {
    background: #212529;
    color: #ffffff;
}

.quant-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.quant-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.quant-table tbody tr:hover {
    background: #f8f9fa;
}

.quant-table .highlight-row {
    background: #e8f5e9;
}

.quant-table .highlight-row:hover {
    background: #c8e6c9;
}

/* Quality Badges */
.quality-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quality-excellent {
    background: #d4edda;
    color: #155724;
}

.quality-great {
    background: #d1ecf1;
    color: #0c5460;
}

.quality-good {
    background: #fff3cd;
    color: #856404;
}

.quality-fair {
    background: #fff0e0;
    color: #c45a00;
}

/* FAQ Section */
.faq-section {
    padding: 3rem 1rem;
    background: #ffffff;
}

.faq-section .container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-section h2 {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #212529;
    margin-bottom: 2rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    transition: background-color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    background: #e9ecef;
}

.faq-item p {
    padding: 0 1.25rem 1rem;
    margin: 0;
    color: #495057;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
}

.breadcrumb-nav .container {
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb-list li a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-list li a:hover {
    color: #212529;
}

.breadcrumb-list li[aria-current="page"] {
    color: #212529;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #adb5bd;
    font-size: 0.7rem;
}

/* Estimation Note */
.estimation-note {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    background: #e3f2fd;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    max-width: 700px;
    margin: 1rem auto 0;
}

.estimation-note i {
    color: #1976d2;
    flex-shrink: 0;
    line-height: 1.5;
}

.estimation-note p {
    margin: 0;
    color: #1565c0;
}

.estimation-note a {
    color: #0d47a1;
    font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .calculator-header {
        padding: 2rem 1rem 1.5rem;
    }

    .calculator-container {
        gap: 1.5rem;
    }

    .fit-status {
        flex-direction: column;
        text-align: center;
    }

    .vram-legend {
        flex-direction: column;
        gap: 0.5rem;
    }

    .performance-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .perf-value {
        font-size: 1.25rem;
    }
}