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

body {
    font-family: Arial, sans-serif;
    line-height: 1.4;
    padding: 15px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

h1 {
    margin-bottom: 15px;
    font-size: 24px;
    text-align: center;
}

h2 {
    margin-top: 20px;
    margin-bottom: 15px;
}

h3 {
    margin-top: 15px;
    margin-bottom: 10px;
}

p {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Toolbar */
.page-toolbar {
    max-width: 900px;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Content sections */
.content-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.content-section.first-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.content-section h2 {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Compatibility and use cases grids */
.compatibility-grid,
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.compatibility-item,
.use-case-item {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.compatibility-item strong,
.use-case-item strong {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-size: 16px;
}

.compatibility-item span,
.use-case-item span {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
}

/* Checkbox containers */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-bottom: 0;
}

.checkbox-container label {
    margin-top: 0;
    margin-bottom: 0;
    font-weight: normal;
}

/* Forms */
form label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

form input[type="text"],
form input[type="date"],
form input[type="time"],
form textarea,
form select {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

form textarea {
    resize: vertical;
    height: 100px;
}

form input:disabled,
form select:disabled,
form textarea:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

form button {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Lists */
ol, ul {
    margin-left: 20px;
    padding-left: 20px;
}

ol li, ul li {
    margin-bottom: 5px;
}

/* Error messages */
.error-message {
    display: none;
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #dc3545;
    border-radius: 8px;
    background-color: #f8d7da;
    color: #721c24;
}

.error-message.show {
    display: block;
}

/* Result elements */
.result-url {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    background-color: #f9f9f9;
    color: #333;
}

.copy-btn {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

/* Mobile */
@media (max-width: 600px) {
    body {
        padding: 8px;
    }
    .container {
        padding: 8px;
    }
    h1 {
        font-size: 20px;
    }
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) {
        background-color: #333;
        color: #fff;
    }
    
    :root:not(.theme-light) a {
        color: #ccc;
    }
    
    :root:not(.theme-light) .container {
        border-color: #666;
    }
    
    :root:not(.theme-light) .content-section {
        border-top-color: #444;
    }
    
    :root:not(.theme-light) .content-section h2 {
        color: #fff;
    }
    
    :root:not(.theme-light) .compatibility-item,
    :root:not(.theme-light) .use-case-item {
        background-color: #444;
        border-color: #666;
    }
    
    :root:not(.theme-light) .compatibility-item strong,
    :root:not(.theme-light) .use-case-item strong {
        color: #fff;
    }
    
    :root:not(.theme-light) .compatibility-item span,
    :root:not(.theme-light) .use-case-item span {
        color: #ccc;
    }
    
    :root:not(.theme-light) form input[type="text"],
    :root:not(.theme-light) form input[type="date"],
    :root:not(.theme-light) form input[type="time"],
    :root:not(.theme-light) form textarea,
    :root:not(.theme-light) form select {
        background-color: #444;
        color: #fff;
        border-color: #666;
    }
    
    :root:not(.theme-light) form input:disabled,
    :root:not(.theme-light) form select:disabled,
    :root:not(.theme-light) form textarea:disabled {
        background-color: #2a2a2a;
        color: #666;
        border-color: #555;
    }
    
    :root:not(.theme-light) .error-message {
        background-color: #4a1f1f;
        border-color: #dc3545;
        color: #ffb3ba;
    }
    
    :root:not(.theme-light) .result-url {
        background-color: #444;
        color: #fff;
        border-color: #666;
    }
}

.theme-dark {
    background-color: #333;
    color: #fff;
}

.theme-dark a {
    color: #ccc;
}

.theme-dark .container {
    border-color: #666;
}

.theme-dark .content-section {
    border-top-color: #444;
}

.theme-dark .content-section h2 {
    color: #fff;
}

.theme-dark .compatibility-item,
.theme-dark .use-case-item {
    background-color: #444;
    border-color: #666;
}

.theme-dark .compatibility-item strong,
.theme-dark .use-case-item strong {
    color: #fff;
}

.theme-dark .compatibility-item span,
.theme-dark .use-case-item span {
    color: #ccc;
}

.theme-dark form input[type="text"],
.theme-dark form input[type="date"],
.theme-dark form input[type="time"],
.theme-dark form textarea,
.theme-dark form select {
    background-color: #444;
    color: #fff;
    border-color: #666;
}

.theme-dark form input:disabled,
.theme-dark form select:disabled,
.theme-dark form textarea:disabled {
    background-color: #2a2a2a;
    color: #666;
    border-color: #555;
}

.theme-dark .error-message {
    background-color: #4a1f1f;
    border-color: #dc3545;
    color: #ffb3ba;
}

.theme-dark .result-url {
    background-color: #444;
    color: #fff;
    border-color: #666;
}

/* ID selectors (highest specificity) */
#language-selector {
    width: auto;
    height: 32px;
    padding: 4px 8px;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: none;
    color: inherit;
}

#theme-switcher {
    width: auto;
    height: 32px;
    padding: 4px 8px;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: none;
    color: inherit;
}

.theme-dark #language-selector,
.theme-dark #theme-switcher {
    background-color: #444;
    color: #fff;
    border-color: #666;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) #language-selector,
    :root:not(.theme-light) #theme-switcher {
        background-color: #444;
        color: #fff;
        border-color: #666;
    }
}