/* RaidInsights — Dark theme */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Navigation */
.top-nav {
    background: #1a1a2e;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #c9a227;
}

.nav-brand {
    color: #c9a227;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #b0b0c0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover { color: #c9a227; }

/* Main content */
main {
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
}

/* Headings */
h1, h2, h3 { color: #ffffff; margin-top: 0; }
h1 { font-size: 1.8rem; border-bottom: 1px solid #2a2a3e; padding-bottom: 0.5rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

/* Links */
a { color: #c9a227; }
a:hover { color: #e0c050; }

/* Cards */
.card {
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2a2a3e;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary {
    background: #c9a227;
    color: #0f0f1a;
}

.btn-primary:hover { background: #e0b830; }

.btn-secondary {
    background: #2a2a3e;
    color: #e0e0e0;
}

.btn-secondary:hover { background: #3a3a4e; }

.btn-danger {
    background: #a03030;
    color: #fff;
}

.btn-danger:hover { background: #c04040; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #b0b0c0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: #12121e;
    border: 1px solid #2a2a3e;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #c9a227;
}

.form-hint {
    font-size: 0.8rem;
    color: #707080;
    margin-top: 0.2rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid #2a2a3e;
}

th {
    background: #1a1a2e;
    color: #c9a227;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover { background: #1a1a2e; }

/* Spell icons */
.spell-icon-sm {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.spell-icon-placeholder {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #2a2a3e;
    border: 1px solid #3a3a5e;
    vertical-align: middle;
    margin-right: 0.4rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #2e1a1a;
    border: 1px solid #a03030;
    color: #ff8080;
}

.alert-warning {
    background: #2e2a1a;
    border: 1px solid #c9a227;
    color: #e0c050;
}

.alert-info {
    background: #1a1a2e;
    border: 1px solid #3050a0;
    color: #80a0ff;
}

.alert-success {
    background: #1a2e1a;
    border: 1px solid #30a030;
    color: #80ff80;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #2a2a3e;
    border-top-color: #c9a227;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background: #2a2a3e; color: #b0b0c0; }
.badge-running { background: #1a2a3e; color: #80a0ff; }
.badge-complete { background: #1a2e1a; color: #80ff80; }
.badge-failed { background: #2e1a1a; color: #ff8080; }

/* Tom Select — dark theme overrides */
.ts-wrapper {
    width: 100%;
}

.ts-wrapper .ts-control,
.ts-wrapper.full .ts-control {
    background: #12121e;
    border: 1px solid #2a2a3e;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.95rem;
    min-height: 2.4rem;
    padding: 0.4rem 0.7rem;
    box-shadow: none;
    cursor: pointer;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
    border-color: #c9a227;
    border-radius: 4px 4px 0 0;
    box-shadow: none;
    outline: none;
}

.ts-wrapper .ts-control .item {
    color: #e0e0e0;
}

.ts-wrapper .ts-control > input::placeholder {
    color: #707080;
}

.ts-wrapper .ts-dropdown {
    background: #12121e;
    border: 1px solid #c9a227;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 100;
    box-shadow: none;
    margin-top: 0;
}

.ts-dropdown-content {
    max-height: 230px;
}

.ts-wrapper .ts-dropdown .option {
    color: #e0e0e0;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ts-wrapper .ts-dropdown .active {
    background: #2a2a3e;
    color: #e0e0e0;
}

.ts-wrapper .ts-dropdown .no-results {
    color: #707080;
    font-style: italic;
    padding: 0.45rem 0.8rem;
}

.ts-wrapper .ts-dropdown .optgroup-header {
    color: #707080;
    background: #12121e;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.8rem 0.1rem;
    border-top: 1px solid #2a2a3e;
    cursor: default;
}

.ts-wrapper .ts-dropdown .optgroup:first-child .optgroup-header {
    border-top: none;
}

/* Collapsible details */
.peer-details {
    margin-top: 1.5rem;
}

.peer-details summary {
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #b0b0c0;
    padding: 0.6rem 0;
    list-style: none;
}

.peer-details summary::before {
    content: '\25b6';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.peer-details[open] summary::before {
    transform: rotate(90deg);
}

.peer-details summary::-webkit-details-marker {
    display: none;
}

/* Wowhead tooltip links */
.wowhead-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #707080;
}

.wowhead-link:hover {
    color: #c9a227;
    border-bottom-color: #c9a227;
}

/* Advanced Settings toggle */
#advanced-details summary::-webkit-details-marker { display: none; }
#advanced-details[open] summary { color: #b0b0c0; }

/* Utility */
.text-center { text-align: center; }
.text-muted { color: #707080; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
