/* ==========================================================================
   DROPDOWNS - Clean, Minimal Design
   Modern floating panels with subtle depth
   ========================================================================== */

.hardware-dropdown,
.ram-dropdown-wrapper,
.resolution-dropdown-wrapper,
.upscaling-dropdown-wrapper {
    position: relative;
    z-index: 1;
}

/* When dropdown is open, bring it to front */
.hardware-dropdown:has(.is-open),
.ram-dropdown-wrapper:has(.is-open),
.resolution-dropdown-wrapper:has(.is-open),
.upscaling-dropdown-wrapper:has(.is-open) {
    z-index: 9999;
}

/* ==========================================================================
   DROPDOWN TRIGGER - Clean card button
   ========================================================================== */

.dropdown-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: clamp(0.625rem, 1.5vw, 0.75rem) clamp(0.875rem, 1.5vw, 1rem);
    background: #222222;
    border: 1px solid #333333;
    border-radius: 10px;
    color: #ffffff;
    font-size: clamp(0.8125rem, 1.2vw + 0.2rem, 0.875rem);
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    touch-action: manipulation;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    position: relative;
}

html.light .dropdown-trigger {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #1a1a1a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.dropdown-trigger:hover {
    border-color: #505050;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

html.light .dropdown-trigger:hover {
    border-color: #b0b0b0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.dropdown-trigger:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.dropdown-trigger.is-open {
    border-color: var(--accent);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

html.light .dropdown-trigger.is-open {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.dropdown-trigger--compact {
    padding: clamp(0.5rem, 1vw, 0.625rem) clamp(0.75rem, 1vw, 0.875rem);
    font-size: clamp(0.75rem, 1.1vw + 0.1rem, 0.8125rem);
    min-height: 38px;
}

.dropdown-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* GPU Price Badge - Subtle design */
.dropdown-price {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 6px;
    color: var(--accent);
    font-size: clamp(0.6875rem, 1vw, 0.75rem);
    font-weight: 600;
    margin-left: auto;
    margin-right: 0.625rem;
}

.dropdown-price svg {
    color: var(--accent);
    width: 12px;
    height: 12px;
}

.dropdown-arrow {
    color: #808080;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
    width: 16px;
    height: 16px;
}

.dropdown-trigger:hover .dropdown-arrow {
    color: #b0b0b0;
}

.dropdown-trigger.is-open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--accent);
}

/* ==========================================================================
   DROPDOWN MENU - Clean floating panel
   ========================================================================== */

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid var(--accent);
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 99999;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    max-height: 320px;
    animation: dropdownSlide 0.15s ease-out;
    overflow: hidden;
}

html.light .dropdown-menu {
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

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

.dropdown-menu--compact {
    max-height: 280px;
}

/* Search field */
.dropdown-search {
    padding: clamp(0.625rem, 1.25vw, 0.75rem);
    border-bottom: 1px solid #2a2a2a;
    background: #161616;
}

html.light .dropdown-search {
    border-bottom-color: #e8e8e8;
    background: #f5f5f5;
}

.dropdown-search input {
    width: 100%;
    padding: clamp(0.5rem, 1vw, 0.625rem) clamp(0.75rem, 1.25vw, 0.875rem);
    background: #222222;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: clamp(0.8125rem, 1.1vw + 0.1rem, 0.875rem);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

html.light .dropdown-search input {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #1a1a1a;
}

.dropdown-search input::placeholder {
    color: #666666;
}

.dropdown-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.08);
}

/* Options container */
.dropdown-options {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #505050;
}

html.light .dropdown-options::-webkit-scrollbar-track {
    background: #f5f5f5;
}

html.light .dropdown-options::-webkit-scrollbar-thumb {
    background: #c0c0c0;
}

/* Group labels */
.dropdown-group-label {
    padding: 0.5rem clamp(0.75rem, 1.25vw, 1rem);
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
    color: #808080;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: sticky;
    top: 0;
    z-index: 5;
}

html.light .dropdown-group-label {
    background: #f0f0f0;
    border-bottom-color: #e0e0e0;
    color: #666666;
}

/* Individual options */
.dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: clamp(0.625rem, 1.25vw, 0.75rem) clamp(0.875rem, 1.5vw, 1rem);
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #252525;
    color: #c0c0c0;
    font-size: clamp(0.75rem, 1.1vw + 0.1rem, 0.8125rem);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-align: left;
    touch-action: manipulation;
    position: relative;
}

html.light .dropdown-option {
    border-bottom-color: #f0f0f0;
    color: #444444;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: #242424;
    color: #ffffff;
}

html.light .dropdown-option:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.dropdown-option.is-selected {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    font-weight: 600;
}

.dropdown-option.is-selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
}

.option-price {
    color: #808080;
    font-size: clamp(0.6875rem, 1vw, 0.75rem);
}

.dropdown-empty {
    padding: clamp(1.5rem, 2.5vw, 2rem);
    text-align: center;
    color: #666666;
    font-size: clamp(0.75rem, 1.1vw + 0.1rem, 0.8125rem);
}

/* ==========================================================================
   ASPECT RATIO TABS - Clean toggle pills
   ========================================================================== */

.aspect-ratio-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    flex-wrap: wrap;
    background: #161616;
}

html.light .aspect-ratio-tabs {
    border-bottom-color: #e8e8e8;
    background: #f5f5f5;
}

.aspect-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: #222222;
    border: 1px solid #333333;
    border-radius: 6px;
    color: #909090;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

html.light .aspect-tab {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #666666;
}

.aspect-tab:hover {
    border-color: #505050;
    color: #ffffff;
    background: #2a2a2a;
}

html.light .aspect-tab:hover {
    border-color: #b0b0b0;
    color: #1a1a1a;
    background: #f8f8f8;
}

.aspect-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1a1a;
    font-weight: 600;
}

.aspect-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #1a1a1a;
    border-radius: 3px;
    color: var(--accent);
}

.aspect-check svg {
    width: 10px;
    height: 10px;
}

/* Both RAM and Resolution use same scroll behavior */
.dropdown-menu--resolution .dropdown-options,
.dropdown-menu--ram .dropdown-options {
    flex: 1;
    overflow-y: auto;
}

/* ==========================================================================
   RAM STATUS ICONS - Clear visual indicators
   ========================================================================== */

.ram-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding-left: 0.625rem;
}

.ram-status-icon svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Insufficient: Red */
.ram-status-icon .icon-insufficient {
    color: var(--error);
}

/* Sufficient: Orange/Yellow */
.ram-status-icon .icon-sufficient {
    color: var(--warning);
}

/* Optimal: Green */
.ram-status-icon .icon-optimal {
    color: var(--success);
}

/* RAM dropdown option layout */
.dropdown-menu--ram .dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    position: relative;
}

.dropdown-menu--ram .dropdown-option span:first-child {
    flex: 1;
}

/* RAM Status Classes for dropdown trigger */
.dropdown-trigger.ram-insufficient {
    border-color: var(--error);
}

.dropdown-trigger.ram-sufficient {
    border-color: var(--warning);
}

.dropdown-trigger.ram-optimal {
    border-color: var(--success);
}

/* RAM Status in dropdown options */
.dropdown-option.ram-insufficient {
    border-left: 2px solid var(--error);
    padding-left: calc(clamp(0.875rem, 1.5vw, 1rem) - 2px);
}

.dropdown-option.ram-sufficient {
    border-left: 2px solid var(--warning);
    padding-left: calc(clamp(0.875rem, 1.5vw, 1rem) - 2px);
}

.dropdown-option.ram-optimal {
    border-left: 2px solid var(--success);
    padding-left: calc(clamp(0.875rem, 1.5vw, 1rem) - 2px);
}

/* RAM Requirements Text */
.ram-requirements {
    font-size: clamp(0.6875rem, 1vw, 0.75rem);
    color: #808080;
    margin-top: 0.5rem;
    padding: 0.5rem 0.625rem;
    background: #1e1e1e;
    border-radius: 6px;
    border: 1px solid #2a2a2a;
}

html.light .ram-requirements {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #666666;
}

.ram-requirements strong {
    color: #c0c0c0;
}

html.light .ram-requirements strong {
    color: #333333;
}

.ram-sep {
    margin: 0 0.375rem;
    opacity: 0.5;
}

/* ==========================================================================
   UPSCALING DROPDOWN WITH TOOLTIPS
   ========================================================================== */

.dropdown-menu--upscaling {
    max-height: 320px;
}

.dropdown-menu--upscaling .dropdown-options {
    flex: 1;
    overflow-y: auto;
}

.upscaling-option-wrapper {
    position: relative;
}

.dropdown-menu--upscaling .dropdown-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.625rem;
}

.upscaling-option-label {
    flex: 1;
}

.upscaling-option-multiplier {
    font-size: 0.75rem;
    color: #808080;
    opacity: 0.9;
    padding: 0.1875rem 0.5rem;
    background: #2a2a2a;
    border: 1px solid #333333;
    border-radius: 5px;
}

html.light .upscaling-option-multiplier {
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #666666;
}

/* Upscaling Tooltip */
.upscaling-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e1e1e;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
    color: #c0c0c0;
    max-width: 240px;
    white-space: normal;
    z-index: 200;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    line-height: 1.5;
    pointer-events: none;
}

html.light .upscaling-tooltip {
    background: #ffffff;
    border-color: #d0d0d0;
    color: #444444;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Arrow pointing right */
.upscaling-tooltip::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #1e1e1e;
}

html.light .upscaling-tooltip::after {
    border-left-color: #ffffff;
}

.upscaling-tooltip::before {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #333333;
}

html.light .upscaling-tooltip::before {
    border-left-color: #d0d0d0;
}

/* Mobile: tooltip below */
@media (max-width: 640px) {
    .upscaling-tooltip {
        right: auto;
        left: 0;
        top: calc(100% + 8px);
        transform: none;
        max-width: calc(100vw - 2.5rem);
    }

    .upscaling-tooltip::after,
    .upscaling-tooltip::before {
        display: none;
    }
}

/* RAM Tooltip Popup */
.ram-tooltip-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 200px;
    padding: 0.875rem 1rem;
    background: #1e1e1e;
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    font-size: clamp(0.75rem, 1.2vw + 0.1rem, 0.8125rem);
}

html.light .ram-tooltip-popup {
    background: #ffffff;
    border-color: #d0d0d0;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.ram-tooltip-popup p {
    margin: 0.375rem 0;
    color: #c0c0c0;
    line-height: 1.5;
}

html.light .ram-tooltip-popup p {
    color: #555555;
}

.ram-tooltip-popup p:first-child {
    margin-top: 0;
}

.ram-tooltip-popup p:last-child {
    margin-bottom: 0;
}

/* Upscaling Info Tooltip */
.upscaling-info-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    max-width: 320px;
    padding: clamp(0.75rem, 1.5vw, 1rem);
    z-index: 1000;
    background: #1e1e1e;
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

html.light .upscaling-info-tooltip {
    background: #ffffff;
    border-color: #d0d0d0;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.upscaling-info-tooltip p {
    margin: 0 0 0.5rem 0;
    color: #c0c0c0;
    line-height: 1.5;
}

html.light .upscaling-info-tooltip p {
    color: #555555;
}

.upscaling-info-tooltip ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.upscaling-info-tooltip li {
    margin: 0.5rem 0;
    padding-left: 0.875rem;
    color: #b0b0b0;
    line-height: 1.5;
    font-size: clamp(0.75rem, 1.1vw + 0.1rem, 0.8125rem);
    position: relative;
}

html.light .upscaling-info-tooltip li {
    color: #555555;
}

.upscaling-info-tooltip li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 4px;
    height: 4px;
    background: #808080;
    border-radius: 50%;
}

.upscaling-info-tooltip strong {
    color: #ffffff;
}

html.light .upscaling-info-tooltip strong {
    color: #1a1a1a;
}
