* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px 0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.icon {
    font-size: 3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

.simulator-panel, .history-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="url"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    margin-bottom: 20px;
}

input[type="url"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

.custom-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.custom-settings.hidden {
    display: none;
}

.test-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.test-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.results-section h2,
.history-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.results {
    min-height: 200px;
}

.result-placeholder,
.history-placeholder {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 1.1rem;
}

.result-item {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.result-item.success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.result-item.error {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.result-item h3 {
    margin-bottom: 15px;
    color: #333;
    word-break: break-all;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.result-row.total {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.label {
    color: #666;
}

.value {
    color: #333;
    font-weight: 500;
}

.latency-chart {
    margin-top: 20px;
    width: 100%;
    height: 200px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.latency-chart.hidden {
    display: none;
}

.history {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.history-item:hover {
    background: #e9ecef;
}

.history-url {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    word-break: break-all;
}

.history-details {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.history-profile {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.history-time {
    color: #4caf50;
    font-weight: 500;
}

.history-status {
    color: #666;
}

.history-timestamp {
    font-size: 0.85rem;
    color: #999;
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
}

.language-selector {
    margin-bottom: 15px;
}

.language-selector select {
    width: auto;
    padding: 8px 15px;
    margin-left: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.language-selector select option {
    color: #333;
    background: white;
}

.copyright {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* スクロールバー */
.history::-webkit-scrollbar {
    width: 8px;
}

.history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.history::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.history::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* レスポンシブ */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .simulator-panel,
    .history-section {
        padding: 20px;
    }
    
    .history-details {
        flex-direction: column;
        gap: 5px;
    }
}