/* =============================================================================
   SHARED STYLES FOR WEB-MULTISELECT EXAMPLES
   Ported verbatim from upstream `@keenmate/web-multiselect/examples-shared.css`.
   ============================================================================= */

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

/* Prevent FOAC (Flash of Unstyled Content) for options */
web-multiselect option {
    display: none;
}

/* Body and layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 2rem;
    background: #f7fafc;
    line-height: 1.6;
}

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

/* Header styling */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

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

.back-link {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Card/Section styles */
.card,
.example-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2,
.example-section h2 {
    margin-bottom: 1rem;
    color: #2d3748;
    font-size: 1.5rem;
}

.card h3,
.example-section h3 {
    margin-bottom: 0.75rem;
    color: #4a5568;
    font-size: 1.25rem;
}

.card p,
.example-section p {
    margin-bottom: 1rem;
    color: #666;
}

/* Description text */
.description {
    color: #718096;
    margin-bottom: 1.5rem;
}

/* Form styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.controls input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Demo areas */
.demo-area {
    margin-bottom: 1.5rem;
}

/* Output display */
.output {
    margin-top: 1rem;
}

.output-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.output pre,
pre {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
    border: 1px solid #e2e8f0;
}

/* Code blocks */
.code-block {
    margin: 1.5rem 0;
    position: relative;
}

.code-block pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Code block copy button */
.code-block .copy-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.code-block .copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Inline code */
code {
    background: #edf2f7;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

/* Reset code styling inside pre and code blocks */
pre code,
.code-block code,
.code-block pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
}

/* Notes/Info boxes */
.note {
    background: #edf2f7;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    margin: 1rem 0;
}

.note.warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.note-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.note ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.note li {
    margin-bottom: 0.5rem;
}

/* Grid layouts */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Typography */
h2 {
    color: #2d3748;
    margin-bottom: 1rem;
}

h3 {
    color: #4a5568;
    margin-bottom: 0.75rem;
}

ul {
    line-height: 1.8;
}

li {
    color: #4a5568;
}

/* Links */
a {
    color: #667eea;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Buttons */
/* Primary button (default) */
button,
button.btn-primary {
    cursor: pointer;
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background 0.2s;
}

button:hover,
button.btn-primary:hover {
    background: #5a67d8;
}

/* Secondary button (gray) */
button.secondary,
button.btn-secondary {
    background: #6b7280;
    color: white;
}

button.secondary:hover,
button.btn-secondary:hover {
    background: #4b5563;
}

/* Outline button (white bg, dark text) */
button.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

button.btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #718096;
    font-size: 0.875rem;
}

footer a {
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .card,
    .example-section {
        padding: 1.5rem;
    }
}
