/* Fără Hârtie - Public Issues Viewer */

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gov-bg-light);
    line-height: 1.6;
    color: var(--gov-text-black);
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    background: var(--gov-bg-white);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--gov-primary-blue);
    color: white;
    padding: 15px 30px;
    text-align: left !important;
}

.header h1 {
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start !important;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.filters {
    padding: 20px 30px;
    background: var(--gov-bg-light);
    border-bottom: 1px solid var(--gov-border-light);
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(100px, 1fr) auto auto auto;
    gap: 12px;
    align-items: flex-end;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.filters.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 30px;
    border-bottom: none;
}

.filters-header {
    display: none; /* Ascuns pe desktop */
    align-items: center;
    justify-content: space-between;
    padding: 0;
    background: transparent;
    border-bottom: none;
    height: 0;
    overflow: hidden;
}

.filters-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gov-text-black);
    font-size: 16px;
    font-weight: 600;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.filters-toggle-btn:hover {
    color: var(--gov-secondary-blue);
}

.filters-toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.filters-toggle-btn[aria-expanded="false"] .filters-toggle-icon {
    transform: rotate(-90deg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gov-text-black);
    margin-bottom: 6px;
}

.filter-group input,
.filter-group select {
    padding: 8px 10px;
    border: 1px solid var(--gov-border-light);
    border-radius: 4px;
    font-size: 13px;
    background: var(--gov-bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    height: 36px;
    width: 100%;
    color: var(--gov-text-black);
    font-family: inherit;
    appearance: none;
    padding-right: 28px;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    box-sizing: border-box;
}

.filter-group select {
    padding-right: 22px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--gov-secondary-blue);
    box-shadow: 0 0 0 3px rgba(0, 121, 193, 0.15);
}

/* Select2 container fixes */
.filter-group .select2-container {
    width: 100% !important;
    display: block;
}

.filter-group .select2-container--default.select2-container--open {
    z-index: 1000;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    grid-column: 5 / 7;
}



.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gov-primary-blue);
    color: white;
    border: 1px solid var(--gov-primary-blue);
}

.btn-primary:hover {
    background: var(--gov-secondary-blue);
    border-color: var(--gov-secondary-blue);
}

.btn-primary:disabled {
    background: var(--gov-border-light);
    color: var(--gov-text-muted);
    border-color: var(--gov-border-light);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--gov-bg-white);
    color: var(--gov-text-black);
    border: 1px solid var(--gov-border-light);
}

.btn-secondary:hover {
    background: var(--gov-bg-light);
}

.table-container {
    padding: 30px;
    overflow-x: auto;
    flex: 1;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #6b7280;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--gov-border-light);
    border-top-color: var(--gov-secondary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.error {
    background: #fff5f5;
    border: 1px solid #ff0000;
    color: #cc0000;
    padding: 15px 20px;
    border-radius: 2px;
    margin: 20px 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--gov-bg-light);
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--gov-text-black);
    border-bottom: 1px solid var(--gov-border-light);
    cursor: pointer;
    user-select: none;
}

th:hover {
    background: var(--gov-bg-white);
}

th.sortable::after {
    content: ' ▼▲';
    opacity: 0.3;
    font-size: 0.75em;
}

th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
    font-size: 0.75em;
}

th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
    font-size: 0.75em;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gov-border-light);
    color: var(--gov-text-black);
}

tbody tr:nth-child(odd) {
    background: var(--gov-bg-white);
}

tbody tr:nth-child(even) {
    background: var(--gov-bg-light);
}

tbody tr:hover {
    background: #e6f0fa;
}

.issue-key {
    font-weight: 600;
    color: var(--gov-secondary-blue);
}

.issue-key a {
    color: inherit;
    text-decoration: none;
}

.issue-key a:hover {
    text-decoration: underline;
}

.date {
    font-size: 13px;
    color: var(--gov-text-muted);
}

.subtask-count {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    background: var(--gov-bg-light);
    color: var(--gov-text-black);
    border: 1px solid var(--gov-border-light);
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-top: 1px solid var(--gov-border-light);
    background: var(--gov-bg-white);
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--gov-text-muted);
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    gap: 10px;
}

#pagination-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gov-text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--gov-text-black);
}

.back-link {
    display: inline-block;
    margin: 20px 30px;
    color: var(--gov-secondary-blue);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.view-subtasks-btn {
    background: var(--gov-bg-white);
    color: var(--gov-secondary-blue);
    border: 1px solid var(--gov-secondary-blue);
    padding: 6px 12px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
    font-weight: 600;
}

.view-subtasks-btn:hover {
    background: var(--gov-secondary-blue);
    color: white;
}

.view-subtasks-btn:disabled {
    background: var(--gov-bg-light);
    color: var(--gov-text-muted);
    border-color: var(--gov-border-light);
    cursor: not-allowed;
}

.subtask-count-badge {
    background: var(--gov-primary-blue);
    color: white;
    padding: 3px 8px;
    border-radius: 2px;
    font-weight: 700;
    font-size: 11px;
    display: inline-block;
}

.subtask-count-text {
    font-weight: 600;
}

.view-subtasks-btn svg {
    width: 16px;
    height: 16px;
    fill: blue;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 80%;
    width: 80%;
    height: 80%;
    min-height: 80%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gov-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gov-bg-white);
}

.modal-header h2 {
    font-size: 20px;
    color: var(--gov-text-black);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gov-text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.modal-close:hover {
    background: var(--gov-bg-light);
    color: var(--gov-text-black);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-loading {
    text-align: center;
    padding: 40px;
    color: var(--gov-text-muted);
}

.modal-loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--gov-border-light);
    border-top-color: var(--gov-secondary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.modal-error {
    background: #fff5f5;
    border: 1px solid #ff0000;
    color: #cc0000;
    padding: 15px;
    border-radius: 2px;
    margin: 10px 0;
}

.subtasks-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.subtasks-table th {
    background: var(--gov-bg-light);
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--gov-border-light);
}

.subtasks-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--gov-border-light);
}

.subtasks-table tr:hover {
    background: var(--gov-bg-light);
}

.subtask-key-link {
    font-weight: 600;
    color: var(--gov-secondary-blue);
    text-decoration: none;
}

.subtask-key-link:hover {
    text-decoration: underline;
}

.no-subtasks {
    text-align: center;
    padding: 30px;
    color: var(--gov-text-muted);
    font-style: italic;
}

.modal-badge {
    display: inline-block;
    background: var(--gov-primary-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Footer styles are in footer.php */

.info-section {
    padding: 20px 30px;
    background: var(--gov-bg-white);
    border-bottom: 1px solid var(--gov-border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.info-section.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 30px;
    border-bottom: none;
}

.info-section-content {
    flex: 1;
    display: flex;
    gap: 15px;
    align-items: center;
}

.info-section-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gov-text-muted);
    padding: 0;
    display: none; /* Ascuns pe desktop */
    width: 0;
    height: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.info-section-close:hover {
    color: var(--gov-text-black);
}

.form-link-box {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.form-link-box a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--gov-primary-blue);
    color: white;
    text-decoration: none;
    border-radius: 2px;
    font-weight: 600;
    transition: background-color 0.2s;
    border: 1px solid var(--gov-primary-blue);
    font-size: 14px;
}

.form-link-box a:hover {
    background: var(--gov-secondary-blue);
    border-color: var(--gov-secondary-blue);
}

.form-link-box svg {
    width: 18px;
    height: 18px;
}

.description-box {
    background: var(--gov-bg-light);
    border: 1px solid var(--gov-border-light);
    border-radius: 2px;
    padding: 15px 18px;
    color: var(--gov-text-black);
    line-height: 1.5;
    font-size: 15px;
    width: 100%;
}

.description-box strong {
    color: var(--gov-primary-blue);
    font-weight: 600;
}

.header-logo {
    height: 45px;
    width: auto;
    vertical-align: middle;
}

@media (max-width: 768px) {
    html {
        height: auto;
    }

    body {
        height: auto;
        min-height: 100vh;
    }

    .info-section {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .info-section-content {
        flex-direction: column;
        width: 100%;
    }

    /* Afișează butonul de închidere pe mobile */
    .info-section-close {
        display: flex;
    }

    .filters {
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Afișează header-ul de filtre pe mobile */
    .filters-header {
        display: flex;
        padding: 0 15px;
    }

    .filter-actions {
        grid-column: 1;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        height: 36px;
        font-size: 13px;
    }

    .table-container {
        padding: 15px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}

/* Hide Turnstile widget - render hidden for background CAPTCHA validation */
#turnstile-container {
    position: fixed !important;
    bottom: -9999px !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -9999 !important;
    overflow: hidden !important;
}
