/* CSS Variables for dynamic sidebar customization */
:root {
    --harta-sidebar-width: 350px;
    --harta-sidebar-height: 73vh;
    --harta-sidebar-top: 20px;
}

/* Prevenire scroll orizontal */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Notificare completare harta - deasupra hărții */
.harta-warning-top {
    width: 100%;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-bottom: 3px solid #ffc107;
    padding: 20px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.2);
}

.warning-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.warning-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.warning-text h3 {
    margin: 0 0 8px 0;
    color: #856404;
    font-size: 1.4em;
    font-weight: bold;
}

.warning-text p {
    margin: 0;
    color: #856404;
    font-size: 1em;
    line-height: 1.4;
}

/* Container principal */
.harta-container { 
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
}

/* Panou informativ din stânga */
.harta-info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: var(--harta-sidebar-width, 320px);
    background-color: #ffffff;
    border: 2px solid #0170B9;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(1, 112, 185, 0.15);
    z-index: 10;
    overflow: hidden;
}

.harta-info-header {
    padding: 20px;
    background: linear-gradient(135deg, #0170B9 0%, #015a94 100%);
    color: white;
    text-align: center;
}

.harta-info-header h2 {
    color: white;
    margin: 0;
    font-size: 1.4em;
    font-weight: bold;
}

.harta-info-content {
    padding: 20px;
    background-color: #fafbfc;
}

.harta-stats {
    margin-bottom: 20px;
}

.hir-data-progress {
    margin-bottom: 20px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #d6e8f9;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(1, 112, 185, 0.08);
}

.hir-data-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.hir-data-progress-label {
    font-size: 0.95em;
    font-weight: 600;
    color: #0170B9;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hir-data-progress-percentage {
    font-size: 1.25em;
    font-weight: 700;
    color: #015a94;
}

.hir-data-progress-bar {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e6f3ff;
    overflow: hidden;
}

.hir-data-progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #0170B9 0%, #00a0d2 100%);
    transition: width 0.4s ease;
}

.hir-data-progress-note {
    margin-top: 12px;
    font-size: 0.85em;
    color: #5b6f81;
    line-height: 1.4;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e8f0f8;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: #0170B9;
}

.stat-value {
    font-weight: bold;
    color: #333;
    background: #e6f3ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.harta-quick-filters {
    margin-top: 20px;
    justify-content: center;
    justify-items: center;
}

.quick-filter-btn {
    display: block;
    width: 85%;
    padding: 12px 15px;
    margin-bottom: 12px;
    background: white;
    border: 2px solid #0170B9;
    border-radius: 8px;
    color: #0170B9;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}

.quick-filter-btn:hover {
    background: #0170B9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 112, 185, 0.3);
}

.quick-filter-btn.active {
    background: #0170B9;
    color: white;
}

/* Notificare completare harta */
.harta-notice {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notice-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    margin-top: 2px;
}

.notice-content h4 {
    margin: 0 0 8px 0;
    color: #856404;
    font-size: 1em;
    font-weight: bold;
}

.notice-content p {
    margin: 0;
    color: #856404;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Secțiune pentru solicitări modificări */
.harta-modification-request {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #0170B9;
    border-radius: 12px;
}

.harta-modification-request h4 {
    margin: 0 0 10px 0;
    color: #0170B9;
    font-size: 1.1em;
    font-weight: bold;
}

.modification-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.modification-btn {
    flex: 1;
    display: inline-block;
    padding: 12px 15px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.email-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
}

.email-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.phone-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #007bff;
}

.phone-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.modification-info {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.modification-info p {
    margin: 0;
    line-height: 1.5;
}

/* Formular simplu pentru solicitări modificări - sub hartă */
.harta-simple-form {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 3px solid #0170B9;
    padding: 30px 0;
    margin-top: 30px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.simple-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h3 {
    margin: 0 0 10px 0;
    color: #0170B9;
    font-size: 1.5em;
    font-weight: bold;
}

.form-header p {
    margin: 0;
    color: #666;
    font-size: 1em;
    line-height: 1.4;
}

.simple-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(1, 112, 185, 0.15);
    border: 2px solid #0170B9;
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #0170B9;
    font-weight: 600;
    font-size: 0.95em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0170B9;
    box-shadow: 0 0 0 3px rgba(1, 112, 185, 0.1);
}

.form-group input:required:invalid {
    border-color: #dc3545;
}

.form-group input:required:valid {
    border-color: #28a745;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: 2px solid #28a745;
    min-width: 200px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.form-footer {
    text-align: center;
    margin-top: 25px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.form-footer p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}
.harta-svg-wrapper { 
    width: 75%; 
    max-width: 900px;
    position: relative;
    margin-left: -50px;
}
#harta-romania-svg { 
    width: 100%; 
    height: auto; 
    max-width: 100%;
}
#harta-romania-svg path { 
    cursor: pointer; 
    transition: fill 0.3s ease-in-out, stroke 0.3s ease-in-out; 
}
#harta-romania-svg path:hover { 
    fill: #4a90e2; 
    stroke: #0170B9; 
    stroke-width: 1; 
}
#harta-romania-svg path.active { 
    fill: #015a94; 
    stroke: #013d6b; 
    stroke-width: 1.5; 
}

/* Inițiale județe */
.county-label {
    fill: #ffffff !important;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    user-select: none;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    paint-order: stroke fill;
    stroke: rgba(1, 61, 107, 0.45);
    stroke-width: 1.6px;
    stroke-linejoin: round;
    text-rendering: optimizeLegibility;
}

@media (max-width: 1024px) {
    .county-label {
        font-size: 11.5px;
        stroke-width: 1.4px;
    }
}

@media (max-width: 768px) {
    .county-label {
        font-size: 10px;
        letter-spacing: 0.05em;
        stroke-width: 1.3px;
    }
}

@media (max-width: 480px) {
    .county-label {
        font-size: 8.6px;
        stroke-width: 1.1px;
    }
}

/* Sidebar - Poziționare pe dreapta, cu spațiu de la header */
.harta-sidebar {
    position: absolute;
    top: var(--harta-sidebar-top, 20px);
    right: 40px;
    width: var(--harta-sidebar-width, 320px);
    height: var(--harta-sidebar-height, 75vh);
    background-color: #ffffff;
    border: 2px solid #0170B9;
    border-radius: 15px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 8px 25px rgba(1, 112, 185, 0.15);
    -webkit-overflow-scrolling: touch;
}

/* Search dropdowns */
.harta-search {
    padding: 20px;
    background: linear-gradient(135deg, #0170B9 0%, #015a94 100%);
    border-bottom: 1px solid #e0e0e0;
    border-radius: 13px 13px 0 0;
}

.harta-search select {
    width: 90%;
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    background-color: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.harta-search select:last-child {
    margin-bottom: 0;
}

.harta-search select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(1, 112, 185, 0.2), 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.harta-search select:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

#county-selector {
    background-color: white;
    border: 2px solid #e0e0e0;
}

#tip-selector {
    width: 60%;
    font-weight: 600;
    background: linear-gradient(135deg, #f8fbff 0%, #e6f3ff 100%);
    border: 2px solid #0170B9;
    color: #0170B9;
}

/* Conținut sidebar */
#harta-sidebar-content {
    padding: 20px;
    background-color: #fafbfc;
}

#harta-sidebar-content h3 {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    color: #0170B9;
    font-size: 1.5em;
    border-bottom: 2px solid #0170B9;
    text-align: center;
}

#harta-sidebar-content h4.sidebar-section-title {
    color: #0170B9;
    font-size: 1.2em;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #0170B9;
}

/* Lista entități */
.lista-entitati {
    margin-bottom: 20px;
}

.item-card {
    background: white;
    border: 1px solid #e8f0f8;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 6px 20px rgba(1, 112, 185, 0.15);
    transform: translateY(-2px);
    border-color: #0170B9;
}

.item-card h5 {
    color: #0170B9;
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: bold;
}

.item-card dl {
    margin: 0;
}

.item-card dt {
    font-weight: bold;
    color: #333;
    margin-top: 8px;
}

.item-card dd {
    margin: 0 0 5px 0;
    color: #666;
}

.item-card a {
    color: #0170B9;
    text-decoration: none;
}

.item-card a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Notificarea de atenționare pe mobil */
    .harta-warning-top {
        padding: 15px 0;
        margin-bottom: 15px;
    }
    
    .warning-content {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
        text-align: center;
    }
    
    .warning-icon {
        font-size: 1.5em;
    }
    
    .warning-text h3 {
        font-size: 1.2em;
    }
    
    .warning-text p {
        font-size: 0.9em;
    }
    
    /* Formularul simplu pe mobil */
    .harta-simple-form {
        padding: 25px 0;
        margin-top: 25px;
    }
    
    .simple-form-container {
        padding: 0 15px;
    }
    
    .form-header h3 {
        font-size: 1.3em;
    }
    
    .form-header p {
        font-size: 0.9em;
    }
    
    .simple-form {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group textarea {
        min-height: 100px;
    }
    
    .submit-btn {
        padding: 12px 30px;
        font-size: 1em;
        min-width: auto;
        width: 100%;
    }
    
    /* Pe mobil, ascundem harta SVG, afișăm ambele panouri centrate */
    .harta-svg-wrapper {
        display: none !important;
    }
    
    .harta-container {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: auto;
        padding: 20px;
        gap: 20px;
    }
    
    /* Panoul informativ din stânga - pe mobil devine primul panou */
    .harta-info-panel {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: 500px;
        margin: 0;
        order: 1;
    }
    
    /* Sidebar-ul - pe mobil devine al doilea panou */
    .harta-sidebar {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        max-width: 500px;
        height: auto;
        border: 2px solid #0170B9;
        border-radius: 15px;
        box-shadow: 0 8px 25px rgba(1, 112, 185, 0.15);
        margin: 0;
        order: 2;
    }
    
    .harta-search {
        border-radius: 7px 7px 0 0;
    }
    
    #harta-sidebar-content {
        border-radius: 0 0 7px 7px;
    }
    
    /* Ajustări pentru panoul informativ pe mobil */
    .harta-info-header h2 {
        font-size: 1.2em;
    }
    
    .harta-info-content {
        padding: 15px;
    }
    
    .harta-stats {
        margin-bottom: 15px;
    }
    
    .stat-item {
        padding: 8px 0;
    }
    
    .harta-quick-filters h4 {
        align-self: self-start;
        font-size: 1em;
        margin-bottom: 12px;
    }
    
    .quick-filter-btn {
        padding: 10px 12px;
        margin-bottom: 6px;
        font-size: 0.9em;
    }
    
    /* Responsive styles for new sections */
    .harta-notice {
        margin-top: 15px;
        padding: 12px;
        gap: 10px;
    }
    
    .notice-content h4 {
        font-size: 0.95em;
    }
    
    .notice-content p {
        font-size: 0.85em;
    }
    
    .harta-modification-request {
        margin-top: 15px;
        padding: 15px;
    }
    
    .harta-modification-request h4 {
        font-size: 1em;
    }
    
    .modification-options {
        flex-direction: column;
        gap: 8px;
    }
    
    .modification-btn {
        padding: 10px 12px;
        font-size: 0.85em;
    }
    
    .modification-info {
        padding: 10px;
    }
    
    .modification-info p {
        font-size: 0.75em;
    }
}

/* Link-uri pentru hărți */
.harta-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0170B9;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.harta-link:hover {
    background-color: #015a94;
    color: white;
    text-decoration: none;
}

.harta-link:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    /* Notificarea de atenționare pe ecrane foarte mici */
    .harta-warning-top {
        padding: 12px 0;
        margin-bottom: 12px;
    }
    
    .warning-content {
        padding: 0 10px;
        gap: 12px;
    }
    
    .warning-icon {
        font-size: 1.3em;
    }
    
    .warning-text h3 {
        font-size: 1.1em;
    }
    
    .warning-text p {
        font-size: 0.85em;
    }
    
    /* Formularul simplu pe ecrane foarte mici */
    .harta-simple-form {
        padding: 20px 0;
        margin-top: 20px;
    }
    
    .simple-form-container {
        padding: 0 10px;
    }
    
    .form-header h3 {
        font-size: 1.2em;
    }
    
    .form-header p {
        font-size: 0.85em;
    }
    
    .simple-form {
        padding: 15px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9em;
    }
    
    .form-group textarea {
        min-height: 80px;
    }
    
    .submit-btn {
        padding: 10px 25px;
        font-size: 0.9em;
    }
    
    .harta-container {
        padding: 10px;
        gap: 15px;
    }
    
    .harta-info-panel,
    .harta-sidebar {
        max-width: 100%;
        border-radius: 10px;
    }
    
    .harta-info-header {
        padding: 15px;
    }
    
    .harta-info-header h2 {
        font-size: 1.1em;
    }
    
    .harta-info-content {
        padding: 12px;
    }
    
    .harta-stats {
        margin-bottom: 12px;
    }
    
    .stat-item {
        padding: 6px 0;
        font-size: 0.9em;
    }
    
    .harta-quick-filters h4 {
        font-size: 0.95em;
        margin-bottom: 10px;
    }
    
    .quick-filter-btn {
        padding: 8px 10px;
        margin-bottom: 5px;
        font-size: 0.85em;
    }
    
    #harta-sidebar-content h3 {
        font-size: 1.2em;
    }
    
    .item-card {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .harta-search {
        padding: 15px;
    }
    
    .harta-search select {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Additional responsive styles for very small screens */
    .harta-notice {
        margin-top: 12px;
        padding: 10px;
        gap: 8px;
    }
    
    .notice-content h4 {
        font-size: 0.9em;
    }
    
    .notice-content p {
        font-size: 0.8em;
    }
    
    .harta-modification-request {
        margin-top: 12px;
        padding: 12px;
    }
    
    .harta-modification-request h4 {
        font-size: 0.95em;
    }
    
    .modification-btn {
        padding: 8px 10px;
        font-size: 0.8em;
    }
    
    .modification-info {
        padding: 8px;
    }
    
    .modification-info p {
        font-size: 0.7em;
    }
}