:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-focus: #3b82f6;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --error-color: #dc2626;
    --success-color: #059669;
    --background-color: #f9fafb;
    --card-background: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #f9fafb;
}

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

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-color);
}

h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.form-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: box-shadow 0.2s ease-in-out;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

label.required::after {
    content: " *";
    color: var(--error-color);
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    background-color: var(--card-background);
}

input[type="text"]:hover,
input[type="url"]:hover,
input[type="datetime-local"]:hover,
select:hover,
textarea:hover {
    border-color: #d1d5db;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

textarea {
    min-height: 100px;
    resize: vertical;
}
/*
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;

    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:focus {
    outline: none;
    background-color: var(--primary-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-secondary:focus {
    background-color: #e5e7eb;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.3);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-primary:focus {
    background-color: var(--primary-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
} */

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

#messages {
    margin-bottom: 1rem;
}

#messages .error-message {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 6px;
}

#messages .success-message {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    padding: 1rem;
    border-radius: 6px;
    color: var(--success-color);
}

/* Nawigacja */
.main-nav {
    background-color: var(--card-background);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.nav-links a:hover {
    color: var(--primary-color);
    background-color: #f3f4f6;
}

.nav-links a.active {
    color: var(--primary-color);
    background-color: #eff6ff;
}

.nav-links a.active::after {
    display: none;
}

/* Responsywność */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }
}

/* Style dla widoku audytu */
.audit-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.audit-header h1 {
    margin: 0;
    flex-grow: 1;
}

.audit-details {
    background: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease-in-out;
}

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

.detail-group {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.detail-group h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.detail-item {
    margin-bottom: 1rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.detail-item .detail-value {
    color: #4b5563;
}

.detail-item .detail-value pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.detail-item .detail-value code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

/* Style dla statusów */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-new { background-color: #dbeafe; color: #1e40af; }
.status-verification { background-color: #fef3c7; color: #92400e; }
.status-checked { background-color: #dcfce7; color: #166534; }
.status-exported { background-color: #f3f4f6; color: #374151; }
.status-archived { background-color: #f3f4f6; color: #6b7280; }

.badge-secondary { background-color: #f3f4f6; color: #6b7280; }

/* Style dla raportów */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.report-item {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease-in-out;
}

.report-item.archived {
    background:#ebebeb;
}

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

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.report-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    flex: 1;
}

.report-title:hover {
    color: var(--primary-color);
}

.report-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.report-description {
    margin-bottom: 1rem;
    color: #4b5563;
}

.report-actions {
    display: flex;
    gap: 1rem;
}

/* Style dla widoku raportu */
.report-details {
    background: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease-in-out;
}

.report-details.archived {
    background: #ebebeb;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
}

.audit-element {
    background: var(--card-background);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.audit-element:last-child {
    margin-bottom: 0;
}

.element-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.element-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-color);
}

.element-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.element-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.element-section {
    background: var(--card-background);
    border-radius: 6px;
    padding: 1rem;
}

.element-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.element-text {
    color: #4b5563;
}

.element-text pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.element-text code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

/* Statusy raportów */
.status-szkic { background-color: #f3f4f6; color: #374151; }
.status-w-trakcie { background-color: #dbeafe; color: #1e40af; }
.status-zakończony { background-color: #dcfce7; color: #166534; }
.status-wyeksportowany { background-color: #fef3c7; color: #92400e; }

/* Style dla edytorów Quill */
.ql-editor {
    min-height: 150px;
    background-color: var(--card-background);
}

.ql-toolbar {
    background-color: var(--card-background);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.ql-container {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.ql-editor pre {
    background-color: var(--card-background);
    padding: 1rem;
    border-radius: 6px;
    margin: 0.5rem 0;
}

.ql-editor code {
    background-color: var(--card-background);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

/* Page break button in Quill toolbar */
.ql-page-break {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    padding: 0;
    margin: 0;
}

.ql-page-break::after {
    content: "PB";
    font-size: 13px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Page break in editor view */
.ql-editor .page-break {
    height: 2px;
    background: #8e8e8e;
    margin: 1em 0;
    position: relative;
}

.ql-editor .page-break::before {
    content: "PAGE BREAK";
    display: block;
    text-align: center;
    color: #666;
    font-size: 0.7em;
    padding-top: 0.1em;
}

/* Kryterium WCAG – code w pierwszej kolumnie: tło jak wiersz, lekko ciemniejszy */
.wcag-rules-table tbody tr td:first-child code {
    background: inherit !important;
    color: black !important;
    filter: brightness(0.95);
    padding: 0.2em 0.4em;
}

/* Style dla tabeli */
.table-container {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--card-background);
    font-weight: 500;
    color: var(--text-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: var(--card-background);
}

.text-center {
    text-align: center;
}

/* Style dla odznak WCAG */
.wcag-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.level-A { background-color: #fee2e2; color: #991b1b; }
.level-AA { background-color: #fef3c7; color: #92400e; }
.level-AAA { background-color: #dbeafe; color: #1e40af; }

/* Style dla typów problemów */
.type-błąd { background-color: #fee2e2; color: #991b1b; }
.type-ostrzeżenie { background-color: #fef3c7; color: #92400e; }
.type-uwaga { background-color: #dbeafe; color: #1e40af; }
.type-rekomendacja { background-color: #dcfce7; color: #166534; font-weight: bold; }
.issue-type.recommendation { color: #1d4ed8; font-weight: bold; }

/* Etykieta typu w tytule elementu (Analiza ekspercka) */
.element-issue-type-label.element-issue-type-error { color: #b91c1c; }
.element-issue-type-label.element-issue-type-recommendation { color: #1d4ed8; }
.element-issue-type-label.element-issue-type-not-applicable { color: #6b7280; }
.error-title { line-height: 1.5; }

.type-informacja { background-color: #f3f4f6; color: #374151; }
.type-inne { background-color: #f3f4f6; color: #374151; }

/* Style dla priorytetów */
.priority-priorytetowy { background-color: #fee2e2; color: #991b1b; }
.priority-ważny { background-color: #fef3c7; color: #92400e; }
.priority-umiarkowany { background-color: #dbeafe; color: #1e40af; }
.priority-brak { background-color: #f3f4f6; color: #374151; }

/* Style dla przewijania do elementu */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

.audit-element {
    scroll-margin-top: 2rem;
}

/* Sugestie pod polami formularza */
.suggestions {
    margin-top: 0.3em;
}
.suggestions .badge {
    margin-right: 10px;
}
.suggestion-item {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    padding: 0.3em 0.6em;
    margin-bottom: 1px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.75rem;
    color: #333;
}
.suggestion-item:hover {
    background: #e0e7ff;
}
.copy-message {
    color: #059669;
    font-size: 0.95em;
    margin: 0.2em 0 0.2em 0;
}
/* Przyciski toggle-suggestions przy etykietach pól */
.toggle-suggestions {
    padding: 0.1em 0.5em;
    font-size: 0.95em;
    margin-left: 0.5em;
    line-height: 1;
    background-color: var(--primary-focus);
}
.form-label.d-flex.align-items-center {
    gap: 0.5em;
}

.page-break-toggle, .remove-illustration-btn {
    padding: 0.1em 0.5em;
    font-size: 0.95em;
    margin-left: 0.5em;
    line-height: 1;
}

.remove-illustration-btn:hover{
    background-color: #dc2626;
    color: #fff;
}

