body {
    padding: 0;
    display: block;
    min-height: 100vh;
}

h1 {
    margin-bottom: 30px;
    text-align: center;
}

form {
    max-width: 600px;
    min-width: 420px;
    width: 100%;
    background: #f6f4ef;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
    margin-left: auto;
    margin-right: auto;
}

form div {
    margin-bottom: 20px;
}

label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 1rem;
}

#author-form, form.delete {
    display: inline-block;
    max-width: none;
    min-width: 0;
    width: auto;
    background: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
}

.field span {
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #555;
}

input[type="file"] {
    display: block;
    margin-top: 5px;
    padding: 8px 12px;
}

input[type="text"].error,
input[type="password"].error,
input[type="file"].error,
textarea.error,
select.error {
    border: 2px solid #dc3545 !important;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 4px;
    display: none;
}

button[type="submit"], .button {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    background-color: #007bff;
    color: #EAEAEA;
    border: 1px solid #007bff;
    border-radius: 2px;
    box-sizing: border-box;
}

button[type="submit"]:hover, .button:hover {
    background-color: #007bff;
    color: white;
}

input[type="checkbox"].red {
    accent-color: red;
}

.article-item {
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #f9f9f9;
}

.article-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.article-header .left {
    text-align: left;
}

.article-header .right {
    text-align: right;
    font-size: 0.9rem;
    color: #666;
}

.article-header .file-name {
    font-size: 0.8rem;
    color: #888;
    display: block;
}

.article-header .title {
    margin: 5px 0 0 0;
    font-size: 1.2rem;
}

.article-body .short-text {
    font-size: 1rem;
    line-height: 1.4;
}

input[readonly], input.read-only {
    cursor: not-allowed;
    pointer-events: none;
}

input[readonly]:focus, input.read-only:focus {
    outline: none;
    box-shadow: none;
}

button[type="submit"]:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.8;
}

button[type="button"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="file"]:disabled,
textarea:disabled,
select:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ced4da;
}

input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/*
 * František status indicators, rendered in normal document flow:
 * green tick = check passed, red cross = check failed, gray dot = still loading.
 */
.status-dot {
    font-weight: bold;
}

.status-ok {
    color: #28a745;
}

.status-fail {
    color: #dc3545;
}

#events-container {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
}

.event-item {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.event-item:last-child {
    border-bottom: none;
}

.event-published {
    color: #28a745;
    font-weight: bold;
}

.event-failed {
    color: #dc3545;
    font-weight: bold;
}

.event-completed {
    color: #007bff;
    font-weight: bold;
    margin-top: 10px;
}

.events-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #dee2e6;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

#btn-stop-poll {
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    font-size: 0.9rem;
    margin-top: 0;
    /* push to the right edge of the events-toolbar flex row */
    margin-left: auto;
    background-color: #dc3545;
    border-color: #dc3545;
}

#btn-stop-poll:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.admin-button {
    width: 380px;
    margin-left: 15px;
}

.account-buttons.right {
    display: flex;
    justify-content: flex-end;
}

.admin-nav {
    margin-bottom: 20px;
    padding: 10px 0;
    padding-bottom: 23px;
    border-bottom: 3px solid #E0E0E0;
}

.admin-nav a {
    font-weight: bold;
    text-decoration: none;
    padding-left: 10px;
    padding-right: 10px;
    color: #007bff;
}

.admin-nav a:hover {
    text-decoration: underline;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #fff;
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-break: break-word;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
    border-top: 1px solid #ddd;
}

.admin-table tr:hover {
    background-color: #f1f1f1;
}

.admin-table-articles th:nth-child(1) {
    width: 20%;
}

.admin-table-articles th:nth-child(2) {
    width: 40%;
}

.admin-table-articles th:nth-child(3) {
    width: 20%;
}

.admin-table-articles th:nth-child(4) {
    width: 10%;
}

.admin-table-articles th:nth-child(5) {
    width: 10%;
}

.admin-table-users th:nth-child(1) {
    width: 30%;
}

.admin-table-users th:nth-child(2) {
    width: 40%;
}

.admin-table-users th:nth-child(3) {
    width: 20%;
}

.admin-table-users th:nth-child(4) {
    width: 10%;
}

td form.delete {
    margin: 0;
}

td form.delete button {
    padding: 5px 10px;
    font-size: 0.85rem;
    width: auto;
    margin: 0;
}

/* František scheduler */
.scheduler-countdown {
    font-variant-numeric: tabular-nums;
    font-family: monospace;
    white-space: nowrap;
}

/* One-liner "add schedule" form: time + category + button on a single row */
.scheduler-add-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scheduler-add-form select {
    width: auto;
    min-width: 120px;
    margin: 0;
}

.scheduler-add-form button[type="submit"] {
    width: auto;
    margin: 0;
}

.cat-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    background: #666;
    white-space: nowrap;
}

/* Per-category colours (keyed by canonical slug) */
.cat-finance      { background: #2e7d32; }
.cat-technologie  { background: #1565c0; }
.cat-veda         { background: #6a1b9a; }
.cat-kultura      { background: #ad1457; }
.cat-sport        { background: #ef6c00; }
.cat-videa        { background: #c62828; }
.cat-larp         { background: #4527a0; }
.cat-republika    { background: #00838f; }
.cat-zahranici    { background: #283593; }
.cat-nexovinky    { background: #37474f; }
.cat-pocitacove_hry { background: #558b2f; }
.cat-default      { background: #666; }
