/* Admin page specific styles */
.admin-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-form, .simulation-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

.simulation-form .admin-toolbar {
    position: sticky;
    top: 0;
    background: white;
    padding: 1rem;
    margin: -1rem -1rem 0 -1rem;
    border-bottom: 2px solid var(--line-color);
    z-index: 100;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: bold;
}

.form-group input, .form-group textarea, .form-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Style for topics grid layout */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.topic-category {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.topic-category label {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.topic-category select[multiple] {
    min-height: 100px;
    width: 100%;
    padding: 0.3rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.topic-category select[multiple] option {
    padding: 0.2rem 0.3rem;
    font-weight: normal;
    color: #333;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.topics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.topic-tag {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.topic-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-button {
    padding: 0.7rem 1.5rem;
    background-color: #111111;
    color: #ffffff;
    border: 2px solid #111111;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    align-self: flex-start;
    box-shadow: 2px 2px 0 #111111;
}

.admin-button:hover {
    background-color: #333333;
    box-shadow: 3px 3px 0 #111111;
}

.admin-button.danger {
    background-color: #e74c3c;
}

.admin-button.danger:hover {
    background-color: #c0392b;
}

.hidden {
    display: none;
}

.preview-container {
    margin-top: 2rem;
    border-top: 1px solid #ddd;
    padding-top: 1rem;
}

.simulation-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 300px;
}

.simulation-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.simulation-info {
    padding: 1rem;
}

.simulation-title {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.simulation-platform {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.simulation-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.simulation-topic {
    background-color: #f1f1f1;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #333;
}

.result-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.xml-output {
    margin-top: 2rem;
}

.xml-output pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: monospace;
}

.note {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.topic-suggestions {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.topic-suggestions p {
    margin: 0;
    color: #666;
}

.topic-suggestions a {
    color: var(--secondary-color);
    text-decoration: none;
    margin-right: 0.3rem;
}

.topic-suggestions a:hover {
    text-decoration: underline;
}

.admin-shell {
    max-width: 1280px;
    margin: 2rem auto 3rem;
    padding: 0 1rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.admin-panel {
    background: var(--surface, #ffffff);
    border: 2px solid var(--ink-strong, #0a0a0a);
    box-shadow: 4px 4px 0 var(--ink-strong, #0a0a0a);
    border-radius: 12px;
    padding: 1.1rem;
}

.admin-panel h2,
.admin-panel h3 {
    margin-top: 0;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-toolbar .admin-button {
    align-self: auto;
}

.admin-button.secondary {
    background-color: #ffe030;
    color: #111111;
    border-color: #111111;
    box-shadow: 2px 2px 0 #111111;
}

.admin-button.secondary:hover {
    background-color: #f5d000;
}

.admin-button.neutral {
    background-color: #334155;
}

.admin-button.neutral:hover {
    background-color: #1e293b;
}

.admin-subtext {
    color: var(--text-muted, #64748b);
    font-size: 0.95rem;
    margin: 0.35rem 0 0;
}

.inline-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.simulation-list {
    display: grid;
    gap: 0.9rem;
}

.simulation-row {
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 0.9rem;
    background: var(--surface-soft, #f8fafc);
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: start;
}

.simulation-row img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dbe2ea;
    background: #fff;
}

.simulation-row h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.simulation-row p {
    margin: 0.2rem 0;
}

.simulation-meta {
    color: var(--text-muted, #64748b);
    font-size: 0.88rem;
}

.simulation-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.topics-input-hint {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.88rem;
}

.admin-status {
    min-height: 2.5rem;
}

.empty-state {
    padding: 1.4rem;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: var(--text-muted, #64748b);
    text-align: center;
}

.hidden-panel {
    display: none;
}

@media (max-width: 980px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .inline-fields {
        grid-template-columns: 1fr;
    }

    .simulation-row {
        grid-template-columns: 1fr;
    }

    .simulation-row img {
        width: 100%;
        height: 180px;
    }

    .simulation-actions {
        flex-direction: row;
    }
}