/* VPN Comparison Plugin Styles */

.vpn-comparison-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Controls Section */
.vpn-comparison-controls {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.vpn-select-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .vpn-select-group {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .vpn-select-container {
        position: relative;
        z-index: auto;
    }
    
    .vpn-dropdown {
        position: relative;
    }
    
    .vpn-dropdown-menu {
        position: relative;
        top: 4px;
        left: 0;
        right: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 1;
    }
    
    .vpn-comparison-controls {
        position: relative;
        z-index: 1;
    }
}

.vpn-select-container label,
.vpn-rate-container label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Custom Dropdown */
.vpn-dropdown {
    position: relative;
    width: 100%;
}

.vpn-dropdown-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vpn-dropdown-selected:hover {
    border-color: #bbb;
}

.vpn-dropdown.open .vpn-dropdown-selected {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.vpn-dropdown-text {
    color: #666;
}

.vpn-dropdown-text.has-value {
    color: #333;
    font-weight: 500;
}

.vpn-dropdown-arrow {
    color: #999;
    transition: transform 0.2s;
}

.vpn-dropdown.open .vpn-dropdown-arrow {
    transform: rotate(180deg);
}

.vpn-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: none;
    overflow: hidden;
}

/* コントロールセクションを高いz-indexに */
.vpn-comparison-controls {
    position: relative;
    z-index: 100;
}

.vpn-select-container {
    position: relative;
    z-index: 101;
}

.vpn-dropdown.open .vpn-dropdown-menu {
    display: block;
}

.vpn-dropdown-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.vpn-dropdown-search svg {
    color: #999;
    flex-shrink: 0;
}

.vpn-dropdown-search input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #333;
}

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

.vpn-dropdown-options {
    max-height: 280px;
    overflow-y: auto;
}

.vpn-dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    color: #333;
}

.vpn-dropdown-option:hover {
    background: #f5f5f5;
}

.vpn-dropdown-option.selected {
    background: #e8f4fd;
    font-weight: 500;
}

.vpn-dropdown-option.hidden {
    display: none;
}

.vpn-dropdown-option.disabled-option {
    display: none;
}

/* Exchange Rate Input */
.vpn-rate-container {
    max-width: 200px;
}

.vpn-rate-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vpn-rate-input-wrapper input {
    width: 100px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vpn-rate-input-wrapper input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.vpn-rate-unit {
    color: #666;
    font-size: 14px;
}

/* Comparison Table */
.vpn-comparison-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    position: relative;
    z-index: 1;
}

.vpn-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.vpn-comparison-table thead {
    background: #f0f0f0;
}

.vpn-comparison-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.vpn-comparison-table th.vpn1-column,
.vpn-comparison-table th.vpn2-column {
    text-align: center;
    vertical-align: middle;
    min-width: 200px;
}

.vpn-comparison-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.vpn-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.vpn-comparison-table tbody tr:hover {
    background: #fafafa;
}

.vpn-table-label {
    font-weight: 500;
    color: #555;
    min-width: 140px;
}

.vpn-table-value {
    text-align: center;
}

.vpn-table-value.vpn1-column,
.vpn-table-value.vpn2-column {
    min-width: 200px;
}

/* VPN Logo in Header */
.vpn-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    width: 100%;
}

.vpn-logo {
    max-width: 120px;
    max-height: 40px;
    object-fit: contain;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

.vpn-name-link {
    display: block;
    color: #4a90d9;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s;
    text-align: center;
    width: 100%;
}

.vpn-name-link:hover {
    color: #2a6ab9;
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 600px) {
    .vpn-comparison-controls {
        padding: 16px;
    }
    
    .vpn-comparison-table th,
    .vpn-comparison-table td {
        padding: 12px;
        font-size: 13px;
    }
    
    .vpn-table-label {
        min-width: 100px;
    }
    
    .vpn-table-value.vpn1-column,
    .vpn-table-value.vpn2-column {
        min-width: 140px;
    }
    
    .vpn-logo {
        max-width: 80px;
        max-height: 30px;
    }
}

/* Scrollbar Styling */
.vpn-dropdown-options::-webkit-scrollbar,
.vpn-comparison-table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.vpn-dropdown-options::-webkit-scrollbar-track,
.vpn-comparison-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.vpn-dropdown-options::-webkit-scrollbar-thumb,
.vpn-comparison-table-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.vpn-dropdown-options::-webkit-scrollbar-thumb:hover,
.vpn-comparison-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Status Badges */
.vpn-status-stable {
    color: #22c55e;
    font-weight: 500;
}

.vpn-status-unstable {
    color: #f59e0b;
    font-weight: 500;
}

.vpn-status-unavailable {
    color: #ef4444;
    font-weight: 500;
}

/* Official Site Button */
.vpn-official-btn {
    display: inline-block;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(74, 144, 217, 0.3);
}

.vpn-official-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #2a5f8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 217, 0.4);
    color: #fff !important;
    text-decoration: none;
}
