:root {
    --primary-color: #007bff;
    --secondary-color: #28a745;
    --background-color: #f4f7f9;
    --card-background: #ffffff;
    --text-color: #333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--card-background);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--primary-color);
}

.language-switcher a {
    color: var(--text-light);
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
    transition: var(--transition);
}
.language-switcher a:hover {
    color: var(--primary-color);
}
.language-switcher a.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Card Styles */
.search-card, .result-card, .history-card, .illustrate-card {
    background: var(--card-background);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px 30px;
    margin-top: 25px;
}

/* Search Form */
.search-card form {
    display: flex;
    gap: 15px;
}
.input-wrapper {
    flex-grow: 1;
    position: relative;
}
.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}
.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}
.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    outline: none;
}

/* --- Button Styles --- */
.submit-button, .secondary-button, .clear-button, .copy-link-btn {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.submit-button:hover, .secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.submit-button:active, .secondary-button:active, .clear-button:active, .copy-link-btn:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: var(--shadow);
}
:is(button, a):focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}


.submit-button {
    background-color: var(--primary-color);
    color: white;
}
.submit-button:hover {
    background-color: #0069d9;
}

/* --- Result Card --- */

.result-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.result-card h2 {
    margin: 0;
    text-align: center;
    color: var(--primary-color);
    word-break: break-all;
}
.result-card h2 i {
    font-size: 0.9em;
    margin-right: 8px;
    vertical-align: middle;
}
.searched-from {
    text-align: center;
    color: var(--text-light);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 14px;
}

.copy-link-btn {
    background-color: #f0f0f0;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
}
.copy-link-btn:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}
.copy-link-btn .fa-solid {
    margin-right: 6px;
}

.info-group {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: 15px;
}
.info-group h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px 0;
}
.info-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.info-group li, .info-group p {
    font-size: 15px;
    margin-bottom: 8px;
    word-break: break-all;
}
.info-group strong {
    color: #000;
    margin-right: 8px;
}

/* Raw Data */
.raw-data-container {
    border-top: 1px solid #f0f0f0;
    margin-top: 25px;
    padding-top: 15px;
}
.details-toggle {
    background: #f0f0f0;
    color: #333;
    border: 1px solid var(--border-color);
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}
.details-toggle:hover {
    background: #e0e0e0;
}
.details-content {
    display: none;
    margin-top: 10px;
}
.details-content pre, .raw-data-wrapper pre {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: 14px;
    color: #212529;
}

/* Guides */
.actions-container {
    margin-top: 25px;
    text-align: center;
}
.secondary-button {
    background-color: #6c757d;
    color: white;
}
.secondary-button:hover {
    background-color: #5a6268;
}

.is-hidden {
    display: none !important;
}

.illustrate-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.illustrate-card .card-header h3 {
    margin: 0;
}
.illustrate-card ol {
    padding-left: 20px;
    margin-bottom: 0;
}

/* History */
.history-card .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.history-card h3 { margin: 0; }
.history-info { color: var(--text-light); font-size: 14px; margin: 0 0 15px 0; }
.clear-button {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    font-size: 13px;
    padding: 5px 10px;
}
.clear-button:hover { background-color: #dc3545; color: white; }
#history-list { list-style: none; padding: 0; margin: 0; }
.history-item {
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
.history-item:hover {
    border-color: var(--primary-color);
    background-color: #eaf4ff;
    transform: scale(1.02);
}
.no-history {
    color: var(--text-light);
    text-align: center;
    padding: 10px;
}

footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 30px;
    color: var(--text-light);
    font-size: 14px;
}
footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h2 { font-size: 20px; }
    .search-card form { flex-direction: column; }
    main { padding: 10px; }
    .search-card, .result-card, .history-card, .illustrate-card {
        padding: 20px;
        margin-top: 20px;
    }
}

/* --- Domain Status Styles --- */
.result-card.status-available {
    background-color: #e9f7ef;
    border-left: 5px solid var(--secondary-color);
}

.result-card.status-reserved {
    background-color: #fff8e1;
    border-left: 5px solid #ffc107;
}

.result-card .status-text {
    font-size: 1.2em;
    font-weight: 500;
    text-align: center;
    margin: 0 0 10px 0;
}

.status-available .status-text {
    color: #155724;
}

.status-reserved .status-text {
    color: #856404;
}