/**
 * Postal Codes Romania - Frontend Styles
 */

/* ============================================================
   VARIABLES
============================================================ */
:root {
    --primary-color: #3182ce;
    --secondary-color: #2c5282;
    --success-color: #48bb78;
    --danger-color: #e53e3e;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ============================================================
   CONTAINER & LAYOUT
============================================================ */
.postal-code-single {
    padding: 40px 20px;
    background: #fff;
}

.postal-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================================
   BREADCRUMBS
============================================================ */
.postal-breadcrumbs {
    margin-bottom: 30px;
    padding: 15px 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-light);
}

.postal-breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.postal-breadcrumbs a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.postal-breadcrumbs strong {
    color: var(--text-color);
    font-weight: 600;
}

/* ============================================================
   HEADER
============================================================ */
.postal-header {
    margin-bottom: 30px;
    text-align: center;
}

.postal-h1 {
    font-size: 2.5em;
    color: var(--text-color);
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

/* ============================================================
   INFO CARD
============================================================ */
.postal-info-card {
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.info-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 5px;
    font-weight: 600;
}

.info-value {
    font-size: 18px;
    color: var(--text-color);
    font-weight: 500;
}

.cod-highlight {
    font-size: 32px;
    color: var(--primary-color);
    font-weight: 700;
}

/* ============================================================
   MAP SECTION
============================================================ */
.postal-map-section {
    margin-bottom: 40px;
}

.postal-map-section h2 {
    font-size: 1.8em;
    color: var(--text-color);
    margin-bottom: 20px;
}

#postal-map {
    height: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 15px;
}

.map-coordinates {
    padding: 15px 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-color);
}

/* ============================================================
   RELATED CODES
============================================================ */
.postal-related {
    margin-bottom: 40px;
}

.postal-related h2 {
    font-size: 1.8em;
    color: var(--text-color);
    margin-bottom: 20px;
}

.related-section {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.related-section h3 {
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 15px;
}

.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-list li {
    margin-bottom: 10px;
}

.related-list a {
    display: inline-block;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.related-list a:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.view-all-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 25px;
    background: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.view-all-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ============================================================
   FAQ SECTION
============================================================ */
.postal-faq {
    margin-bottom: 40px;
}

.postal-faq h2 {
    font-size: 1.8em;
    color: var(--text-color);
    margin-bottom: 20px;
}

.faq-item {
    background: var(--bg-light);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.faq-item h3 {
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.faq-item p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* ============================================================
   LEAFLET MAP CUSTOMIZATION
============================================================ */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 15px;
    font-size: 14px;
}

.leaflet-popup-content strong {
    color: var(--primary-color);
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
    .postal-code-single {
        padding: 20px 15px;
    }
    
    .postal-h1 {
        font-size: 1.8em;
    }
    
    .postal-info-card {
        padding: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cod-highlight {
        font-size: 24px;
    }
    
    #postal-map {
        height: 300px;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ARCHIVE PAGES (TAXONOMIES)
============================================================ */
.postal-archive {
    padding: 40px 20px;
}

.archive-header {
    text-align: center;
    margin-bottom: 40px;
}

.archive-header h1 {
    font-size: 2.5em;
    color: var(--text-color);
    margin-bottom: 10px;
}

.archive-description {
    font-size: 1.1em;
    color: var(--text-light);
}

.postal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.postal-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.postal-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.postal-card-cod {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
}

.postal-card-address {
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 5px;
}

.postal-card-location {
    color: var(--text-light);
    font-size: 14px;
}

.postal-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Pagination */
.postal-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.postal-pagination a,
.postal-pagination span {
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.postal-pagination a:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.postal-pagination .current {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* ============================================================
   SEARCH FORM
============================================================ */
.postal-search-form {
    max-width: 600px;
    margin: 0 auto 40px;
}

.postal-search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    transition: var(--transition);
}

.postal-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.postal-search-button {
    margin-top: 15px;
    padding: 15px 30px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.postal-search-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ============================================================
   UTILITY CLASSES
============================================================ */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* ── Copy Button ──────────────────────────────────────────── */

.info-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #2c5282;
    transform: translateY(-1px);
}

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

.copy-btn--success {
    background: #38a169 !important;
}

/* ── How To Send Letter ───────────────────────────────────── */

.postal-how-to {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #3182ce;
}

.postal-how-to h2 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: #1a202c;
}

.postal-how-to > p {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
}

.address-format-box {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.address-format-label {
    background: #edf2f7;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.address-format-content {
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    line-height: 2;
}

.address-line {
    display: flex;
    gap: 10px;
}

.addr-field {
    color: #718096;
    font-size: 13px;
    min-width: 90px;
    padding-top: 2px;
}

.how-to-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #4a5568;
    line-height: 1.5;
}

.tip-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

@media (max-width: 600px) {
    .address-format-content {
        font-size: 13px;
    }
    .addr-field {
        min-width: 70px;
    }
}

/* ── Breadcrumbs ──────────────────────────────────────────── */

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    gap: 6px;
}
.breadcrumbs li {
    display: flex;
    align-items: center;
    font-size: 14px;
}
.breadcrumbs a {
    color: #3182ce;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}
.breadcrumbs .breadcrumb-separator {
    color: #999;
    font-size: 12px;
}
.breadcrumbs span[itemprop="name"] {
    color: #333;
}
.breadcrumbs li:last-child span {
    font-weight: 600;
    color: #111;
}

/* ── Post Office Distance ─────────────────────────────────── */

.post-office-distance {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
    font-size: 14px;
}

.distance-loading {
    color: #718096;
}

.distance-result {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: #2d3748;
}

.distance-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.distance-maps-link {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
    margin-left: auto;
}

.distance-maps-link:hover {
    text-decoration: underline;
}

/* ── City Count Badge ─────────────────────────────────────── */

.city-count {
    font-size: 13px;
    font-weight: normal;
    color: #718096;
    margin-left: 6px;
}

@media (max-width: 600px) {
    .distance-result {
        flex-direction: column;
        align-items: flex-start;
    }
    .distance-maps-link {
        margin-left: 0;
    }
}

/* ── Inline Search Widget ─────────────────────────────────── */

.postal-search-widget {
    position: relative;
    margin-bottom: 24px;
}

.postal-search-form-inline {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.postal-search-input-inline {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 10px 0 0 10px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.postal-search-input-inline:focus {
    border-color: #3182ce;
}

.postal-search-btn {
    padding: 14px 22px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 0 10px 10px 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.postal-search-btn:hover {
    background: #2c5282;
}

.postal-search-results-inline {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 360px;
    overflow-y: auto;
}

.postal-search-results-inline.active {
    display: block;
}

.search-results-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.search-result-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #2d3748;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: #ebf8ff;
}

.search-cod {
    font-weight: 700;
    color: #3182ce;
    font-size: 15px;
    min-width: 60px;
    flex-shrink: 0;
}

.search-details {
    font-size: 14px;
    color: #718096;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-loading,
.search-empty,
.search-more {
    padding: 14px 16px;
    font-size: 14px;
    color: #718096;
    text-align: center;
}

@media (max-width: 600px) {
    .postal-search-btn {
        padding: 14px 14px;
        font-size: 14px;
    }
    .postal-search-input-inline {
        font-size: 15px;
    }
}

/* ============================================================
   ARCHIVE LAYOUT (taxonomy-localitate / taxonomy-judet)
============================================================ */

.postal-archive {
    padding: 40px 20px;
    background: #f7fafc;
    min-height: 60vh;
}

.archive-header {
    margin-bottom: 30px;
}

.archive-h1 {
    font-size: 2em;
    color: #1a202c;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.archive-judet {
    font-weight: 400;
    color: #718096;
    font-size: 0.85em;
}

.archive-subtitle {
    color: #718096;
    font-size: 15px;
    margin: 0;
}

/* Two-column layout: main + sidebar */
.archive-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    align-items: start;
}

/* ── Archive List ─────────────────────────────────────────── */

.archive-main {
    min-width: 0;
}

.archive-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
}

.archive-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    text-decoration: none;
    color: #2d3748;
    border-bottom: 1px solid #f0f4f8;
    transition: background 0.15s;
}

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

.archive-item:hover {
    background: #ebf8ff;
}

.archive-item-cod {
    font-weight: 700;
    color: #3182ce;
    font-size: 16px;
    min-width: 70px;
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
}

.archive-item-details {
    flex: 1;
    font-size: 14px;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-item-arrow {
    color: #cbd5e0;
    font-size: 16px;
    flex-shrink: 0;
}

.archive-item:hover .archive-item-arrow {
    color: #3182ce;
}

/* ── Pagination ───────────────────────────────────────────── */

.archive-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #3182ce;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.archive-pagination .page-numbers.current {
    background: #3182ce;
    color: #fff;
    border-color: #3182ce;
}

.archive-pagination .page-numbers:hover:not(.current) {
    background: #ebf8ff;
    border-color: #3182ce;
}

.archive-pagination .page-numbers.prev,
.archive-pagination .page-numbers.next {
    width: auto;
    padding: 0 14px;
}

/* ── Empty state ──────────────────────────────────────────── */

.archive-empty {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: #718096;
}

.btn-reset {
    display: inline-block;
    margin-top: 12px;
    color: #3182ce;
    text-decoration: none;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.archive-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ebf8ff;
}

/* Filter form */
.filter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.filter-input:focus {
    border-color: #3182ce;
}

.filter-btn {
    padding: 10px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-btn:hover {
    background: #2c5282;
}

.filter-reset {
    text-align: center;
    font-size: 13px;
    color: #e53e3e;
    text-decoration: none;
}

.filter-reset:hover {
    text-decoration: underline;
}

/* Sidebar info list */
.sidebar-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #4a5568;
}

.sidebar-info-list span {
    color: #718096;
}

.sidebar-link-btn {
    display: block;
    padding: 10px 14px;
    background: #ebf8ff;
    color: #3182ce;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.sidebar-link-btn:hover {
    background: #bee3f8;
}

/* Responsive */
@media (max-width: 768px) {
    .archive-layout {
        grid-template-columns: 1fr;
    }

    .archive-sidebar {
        order: -1;
    }

    .archive-h1 {
        font-size: 1.5em;
    }
}

/* ── Judet archive specific ───────────────────────────────── */

.archive-item-loc {
    font-size: 13px;
    color: #718096;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 8px;
}

.sidebar-loc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px;
    overflow-y: auto;
}

.sidebar-loc-list li {
    margin-bottom: 6px;
}

.sidebar-loc-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: #2d3748;
    font-size: 14px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.15s;
}

.sidebar-loc-link:hover {
    background: #ebf8ff;
    border-color: #90cdf4;
    color: #2c5282;
}

.sidebar-loc-link.active {
    background: #3182ce;
    border-color: #3182ce;
    color: #fff;
    font-weight: 600;
}

.sidebar-loc-link.active .loc-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.loc-count {
    font-size: 12px;
    color: #718096;
    background: #fff;
    border-radius: 20px;
    padding: 2px 9px;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    flex-shrink: 0;
}
