/* Mist Examples Elegant Style System */

:root {
    /* Light Mode Palette */
    --bg-body: #f9fafb;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    
    --border-width: 1px;
    --border-color: #e5e7eb;
    --border-radius: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --color-primary: #f3f4f6; 
    --color-accent: #3b82f6;
    --color-accent-hover: #2563eb;
    --color-accent-text: #ffffff;
    
    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-success: #10b981;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #030712;
        --bg-card: #111827;
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        
        --border-color: #1f2937;
        
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);

        --color-primary: #1f2937;
        --color-accent: #3b82f6;
        --color-accent-hover: #60a5fa;
        --color-accent-text: #ffffff;
    }
}

/* Base Styles */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem 2rem;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 1rem 0;
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 1.5rem; }

p {
    margin: 0 0 1rem 0;
}

.desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    margin-top: 0.5rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-hover);
}

/* Cards and Containers */
.card {
    background-color: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Utilities */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background-color: var(--color-primary);
    color: var(--text-secondary);
    width: fit-content;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-sm { max-width: 400px; }

.text-huge {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin: 0.5rem 0;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.back-link {
    display: inline-flex;
    align-items: center;
    margin-bottom: 2rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.back-link:hover {
    color: var(--text-primary);
}

/* Navigation Lists */
ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

li {
    background-color: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

li:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

li a {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    box-sizing: border-box;
}

li a:hover {
    color: var(--color-accent);
}

/* Buttons */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 99px; /* Pill shape for buttons */
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

button:hover {
    background-color: var(--color-primary);
    border-color: var(--border-color);
}

button:active {
    transform: translateY(1px);
}

button.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-accent-text);
    border-color: transparent;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

button.btn-primary:hover {
    background-color: var(--color-accent-hover);
    color: var(--color-accent-text);
}

/* Specific Button Variants */
button[mist-action="delete"],
.btn-danger {
    color: var(--color-danger);
    background-color: #fee2e2;
    border-color: transparent;
    box-shadow: none;
}

button[mist-action="delete"]:hover,
.btn-danger:hover {
    background-color: #fecaca;
    color: var(--color-danger-hover);
}

@media (prefers-color-scheme: dark) {
    button[mist-action="delete"],
    .btn-danger {
        background-color: #450a0a;
    }
    
    button[mist-action="delete"]:hover,
    .btn-danger:hover {
        background-color: #7f1d1d;
    }
}

/* Utilities Ext */
.p-4 { padding: 1rem; }

/* Flashcard Specific Styles */
.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.flashcard {
    perspective: 1000px;
    height: 180px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    background-color: var(--bg-card);
    box-sizing: border-box;
}

.flashcard-back {
    transform: rotateY(180deg);
    background-color: var(--color-primary);
    border-color: transparent;
}

.flashcard-language-label {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.flashcard-text {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}

.flashcard-actions {
    position: absolute;
    bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

.flashcard-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Team profile (multi-model InstanceComponent) */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
}

.profile-card {
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    background-color: var(--bg-card);
}

.profile-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.profile-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.profile-handle {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.profile-bio {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.inline-code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--color-accent);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
}