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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #00d9ff;
}

.section {
    background: #16213e;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.section h2 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #00d9ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

input,
textarea,
select {
    background: #0f3460;
    border: 1px solid #00d9ff33;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #00d9ff;
}

input[type="text"] {
    flex: 1;
    min-width: 150px;
}

textarea {
    width: 100%;
    min-height: 80px;
    font-family: "Fira Code", monospace;
    resize: vertical;
}

button {
    background: linear-gradient(135deg, #00d9ff, #0099ff);
    color: #000;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.3);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #0f3460;
    color: #00d9ff;
    border: 1px solid #00d9ff;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    display: block;
}

.method-select {
    min-width: 100px;
}

/* 결과 카드 */
.result-card {
    background: #0f3460;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.result-card.success {
    border-color: #2ed573;
}

.result-card.failed {
    border-color: #ff4757;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.result-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.result-badge.success {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.result-badge.failed {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.result-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.result-error {
    color: #ff6b81;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 6px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.detail-box {
    background: #1a1a2e;
    border-radius: 6px;
    padding: 12px;
}

.detail-box-title {
    font-size: 11px;
    color: #00d9ff;
    margin-bottom: 8px;
    font-weight: 600;
}

.detail-box-content {
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    color: #ccc;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 히스토리 스타일 */
.history-group {
    background: #0f3460;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.history-group-header {
    padding: 15px;
    background: #0a2647;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-group-header:hover {
    background: #0d2d52;
}

.history-group-header .url {
    font-weight: 600;
    color: #00d9ff;
    word-break: break-all;
}

.history-group-header .meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: #888;
}

.history-group-content {
    display: none;
    padding: 15px;
}

.history-group-content.open {
    display: block;
}

.test-name-group {
    background: #16213e;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

.test-name-header {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #00d9ff;
}

.test-name-header:hover {
    background: #1a3a5c;
}

.test-name-header .name {
    font-weight: 600;
    color: #fff;
}

.test-name-header .count {
    font-size: 11px;
    color: #888;
    background: #0f3460;
    padding: 3px 8px;
    border-radius: 10px;
}

.test-name-content {
    display: none;
    padding: 10px 15px;
    border-top: 1px solid #0f3460;
}

.test-name-content.open {
    display: block;
}

.history-entry {
    background: #0f3460;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 3px solid;
}

.history-entry:last-child {
    margin-bottom: 0;
}

.history-entry.success {
    border-color: #2ed573;
}

.history-entry.failed {
    border-color: #ff4757;
}

.history-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-entry-time {
    font-size: 11px;
    color: #888;
}

.history-entry-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.history-entry-status.success {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.history-entry-status.failed {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.history-entry-meta {
    font-size: 11px;
    color: #666;
}

.history-entry-actions {
    margin-top: 8px;
    display: flex;
    gap: 5px;
}

.history-detail-toggle {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1a1a2e;
}

.history-detail-toggle.open {
    display: block;
}

.toggle-icon {
    transition: transform 0.2s;
    font-size: 10px;
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ed573;
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* 자동완성 */
.suggestion {
    position: relative;
}

.suggestion-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f3460;
    border: 1px solid #00d9ff;
    border-radius: 0 0 8px 8px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggestion-list.show {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
}

.suggestion-item:hover {
    background: #1a4a7a;
}
