@import "spells.css";

:root {
    color-scheme: light;
    --color-bg-muted: #f1f5f9;
    --color-surface: #ffffff;
    --color-border: #cbd5f5;
    --color-text-primary: #0f172a;
    --color-text-secondary: #1f2937;
    --color-text-muted: #475569;
    --color-header-background: linear-gradient(135deg, #4f46e5, #6366f1);
    --color-header-text: #f8fafc;
}

html.dark {
    color-scheme: dark;
    --color-bg-muted: #0f172a;
    --color-surface: #111827;
    --color-border: #1f2937;
    --color-text-primary: #f8fafc;
    --color-text-secondary: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-header-background: #0b1220;
    --color-header-text: #e2e8f0;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-bg-muted);
    color: var(--color-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-shell {
    min-height: 100vh;
    background: var(--color-bg-muted);
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-header {
    background: var(--color-header-background);
    color: var(--color-header-text);
    box-shadow: 0 18px 35px rgba(79, 70, 229, 0.15);
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

html.dark .app-header {
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.6);
}

.app-header__content {
    margin-left: auto;
    margin-right: auto;
    max-width: 80rem;
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-layout {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (min-width: 768px) {
    .app-layout {
        flex-direction: row;
    }
}

.app-sidebar {
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

@media (min-width: 768px) {
    .app-sidebar {
        max-width: 16rem;
        border-bottom: none;
        border-right: 1px solid var(--color-border);
    }
}

.app-main {
    flex: 1 1 auto;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.app-main__content {
    margin-left: auto;
    margin-right: auto;
    max-width: 80rem;
    width: 100%;
    padding: 1.5rem 1rem 2rem;
}

@media (min-width: 640px) {
    .app-main__content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
}

.theme-panel {
    background-color: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-primary) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.theme-divider {
    background-color: var(--color-border) !important;
}

.theme-text-secondary {
    color: var(--color-text-secondary) !important;
}

.theme-text-muted {
    color: var(--color-text-muted) !important;
}

.theme-input,
input,
textarea,
select {
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    border-color: var(--color-border);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

table {
    color: var(--color-text-secondary);
}

th {
    color: var(--color-text-primary);
}

td {
    color: var(--color-text-secondary);
}

.theme-muted-surface {
    background-color: var(--color-bg-muted) !important;
}

.theme-soft-border {
    border-color: rgba(148, 163, 184, 0.35) !important;
}

.theme-table-header {
    background-color: rgba(148, 163, 184, 0.12) !important;
}

html.dark .theme-table-header {
    background-color: rgba(100, 116, 139, 0.25) !important;
}

html.dark a:hover {
    color: #c7d2fe;
}

html.dark .bg-white {
    background-color: #0f172a !important;
}

html.dark .bg-slate-50 {
    background-color: #1e293b !important;
}

html.dark .bg-slate-100 {
    background-color: #111827 !important;
}

html.dark .border-slate-200 {
    border-color: #1f2937 !important;
}

html.dark .border-slate-300 {
    border-color: #334155 !important;
}

html.dark .text-slate-900 {
    color: #f1f5f9 !important;
}

html.dark .text-slate-800 {
    color: #e2e8f0 !important;
}

html.dark .text-slate-700 {
    color: #cbd5f5 !important;
}

html.dark .text-slate-600 {
    color: #94a3b8 !important;
}

html.dark .text-slate-500 {
    color: #a5b4fc !important;
}

html.dark .text-slate-400 {
    color: #c4b5fd !important;
}

html.dark .shadow {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.45) !important;
}

html.dark .hover\:bg-indigo-50:hover {
    background-color: rgba(129, 140, 248, 0.18) !important;
}

html.dark .hover\:bg-slate-100:hover {
    background-color: rgba(148, 163, 184, 0.18) !important;
}

html.dark .hover\:bg-red-50:hover {
    background-color: rgba(248, 113, 113, 0.18) !important;
}

html.dark .hover\:bg-amber-50:hover {
    background-color: rgba(253, 230, 138, 0.18) !important;
}

html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #1f2937 !important;
}

html.dark .bg-amber-50 {
    background-color: rgba(253, 230, 138, 0.15) !important;
    color: #fde68a !important;
}

.identity-card-preview {
    margin-top: 0.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.identity-card-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.subclass-card-grid {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.subclass-card-grid figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.subclass-card-grid img {
    display: block;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.subclass-card-grid figcaption {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

.spell-selection-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.spell-selection-checkbox {
    margin-top: 0.5rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.375rem;
    border: 1px solid #c7d2fe;
}

.spell-selection-preview {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    background-color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.spell-selection-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.spell-selection-fallback {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.5rem;
    text-align: center;
    color: #0f172a;
    background-color: #e2e8f0;
}

.spell-selection-fallback__title {
    font-size: 1rem;
    font-weight: 600;
}

.spell-selection-fallback__meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
}

.spell-selection-fallback__summary {
    font-size: 0.875rem;
    color: #1f2937;
}

html.dark .spell-selection-preview {
    background-color: rgba(15, 23, 42, 0.6);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

html.dark .spell-selection-checkbox {
    border-color: #6366f1;
}

html.dark .spell-selection-fallback {
    color: #e2e8f0;
    background-color: rgba(30, 41, 59, 0.85);
}

html.dark .spell-selection-fallback__meta {
    color: #cbd5f5;
}

html.dark .spell-selection-fallback__summary {
    color: #e2e8f0;
}

html.dark .subclass-card-grid figcaption {
    color: #cbd5f5;
}
