/* CSS Variables for easy theming */
:root {
    /* Light Theme (Default) */
    --background-color: #ffffff;
    --surface-color: #f1f3f4;
    --primary-color: #6200ee;
    --on-surface-color: #202124;
    --on-surface-secondary-color: #5f6368;
    --border-color: #dfe1e5;
    --primary-button-text: #ffffff;
    --copy-button-bg: #e0e0e0;
    --copy-button-text: #3c4043;
    --copy-button-hover-bg: #d0d0d0;
    --error-color: #d93025;
    --border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #121212;
        --surface-color: #1e1e1e;
        --primary-color: #bb86fc;
        --on-surface-color: #e0e0e0;
        --on-surface-secondary-color: #a0a0a0;
        --border-color: #3c4043;
        --primary-button-text: #000000;
        --copy-button-bg: #3c4043;
        --copy-button-text: #e0e0e0;
        --copy-button-hover-bg: #4a4a4a;
        --error-color: #cf6679;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--on-surface-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 650px;
    padding-top: 2rem;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

header p {
    margin-bottom: 2.5rem;
    color: var(--on-surface-secondary-color);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#url-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

/* Visually hidden label for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

#url-input {
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    color: var(--on-surface-color);
    outline: none;
    transition: border-color 0.3s;
    text-align: center;
}

#url-input:focus {
    border-color: var(--primary-color);
}

button[type="submit"] {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: var(--primary-button-text);
    cursor: pointer;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    opacity: 0.9;
}

#results-container {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: left;
    min-height: 100px;
    transition: opacity 0.3s;
    margin-bottom: 30px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th, .results-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    text-align: left;
    color: var(--primary-color);
    font-weight: bold;
}

.results-table td {
    word-break: break-all;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.info-message {
    color: var(--on-surface-secondary-color);
    text-align: center;
    width: 100%;
}

.error-message {
    color: var(--error-color);
    text-align: center;
    width: 100%;
    font-weight: bold;
}

.features {
    margin-bottom: 40px;
    text-align: left;
}

.features h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.features ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.features li {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
}

.features .material-icons {
    color: var(--primary-color);
    font-size: 36px;
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.features h3 {
    text-align: center;
    margin-bottom: 10px;
}

.features p {
    color: var(--on-surface-secondary-color);
    font-size: 0.95em;
    text-align: center;
}

footer {
    margin-top: 40px;
    color: var(--on-surface-secondary-color);
    font-size: 0.9em;
}

.copy-btn {
    margin-left: 8px;
    padding: 4px;
    font-size: 0.95em;
    border: none;
    border-radius: 50%;
    background-color: var(--copy-button-bg);
    color: var(--copy-button-text);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}
.copy-btn:hover:not(:disabled) {
    background-color: var(--copy-button-hover-bg);
}
.copy-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.copy-btn .material-icons {
    font-size: 18px;
    vertical-align: middle;
}
