/* =====================================================================
   NBCRS3 ReestrTic — Main Stylesheet
   Design: Deep Indigo + Mint/Teal + Coral (SOTI style)
   ===================================================================== */

/* CSS Variables */
:root {
    --deep-indigo: #1a1a4e;
    --deep-indigo-light: #2d2d6e;
    --mint-teal: #2a9d8f;
    --mint-teal-light: #3ab8a8;
    --coral: #e76f51;
    --coral-dark: #c95a3d;
    --orange: #ff6a00;
    --orange-light: #ff8533;
    --light-bg: #f8f9fa;
    --card-border: #e8ecef;
    --text-muted-custom: #6c757d;
    --shadow-sm: 0 2px 8px rgba(26, 26, 78, 0.08);
    --shadow-md: 0 4px 16px rgba(26, 26, 78, 0.12);
    --shadow-lg: 0 8px 32px rgba(26, 26, 78, 0.16);
}

/* =====================================================================
   Typography
   ===================================================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f0f2f5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, serif;
    color: var(--deep-indigo);
}

a {
    color: var(--mint-teal);
    text-decoration: none;
}

a:hover {
    color: var(--mint-teal-light);
    text-decoration: underline;
}

/* =====================================================================
   Navbar
   ===================================================================== */

.tic-navbar {
    background-color: var(--deep-indigo) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tic-navbar-brand {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff !important;
    letter-spacing: 0.02em;
}

.tic-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
    transition: color 0.2s ease;
}

.tic-navbar .nav-link:hover,
.tic-navbar .nav-link:focus {
    color: var(--coral) !important;
}

.tic-navbar .dropdown-menu {
    background-color: var(--deep-indigo-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.tic-navbar .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
}

.tic-navbar .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tic-navbar .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.15);
}

/* =====================================================================
   Page Container
   ===================================================================== */

.pagecontainer {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 28px 32px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* =====================================================================
   Page Header
   ===================================================================== */

.tic-page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--card-border);
}

.tic-page-header h1,
.tic-page-header h3 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.tic-page-intro {
    color: var(--text-muted-custom);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* =====================================================================
   Filters
   ===================================================================== */

.tic-filters {
    background-color: var(--light-bg);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--card-border);
}

.tic-filters label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--deep-indigo);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.tic-filters .form-control,
.tic-filters .form-select {
    border-radius: 8px;
    border-color: #ced4da;
    font-size: 0.875rem;
}

.tic-filters .form-control:focus,
.tic-filters .form-select:focus {
    border-color: var(--mint-teal);
    box-shadow: 0 0 0 0.2rem rgba(42, 157, 143, 0.2);
}

/* =====================================================================
   TIC Card (ticRow)
   ===================================================================== */

.ticRow {
    background-color: #fff;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

.ticRow:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* NAITO indicator via ::before pseudo-element */
.ticRow.is-naito::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--coral), var(--orange));
}

.ticRow.is-best-tic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f0c040, #f0a030);
}

.tic-card-body {
    padding: 16px;
}

/* Logo column */
.ticLogoCol {
    padding: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.ticLogoDiv {
    width: 100%;
    height: 140px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    border-radius: 6px;
    background-color: var(--light-bg);
}

.ticLogoPlaceholder {
    width: 100%;
    height: 140px;
    border-radius: 6px;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 2.5rem;
}

/* TIC Name */
.ticName {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--deep-indigo);
    margin-bottom: 6px;
    line-height: 1.4;
}

.ticName a {
    color: var(--deep-indigo);
}

.ticName a:hover {
    color: var(--mint-teal);
    text-decoration: none;
}

/* TIC meta fields */
.ticAddress,
.ticRegion,
.ticPhone,
.ticSite {
    font-size: 0.82rem;
    color: #555;
    margin-bottom: 4px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.ticAddress i,
.ticRegion i,
.ticPhone i,
.ticSite i {
    color: var(--mint-teal);
    margin-top: 2px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.ticRegion {
    color: var(--text-muted-custom);
    font-size: 0.8rem;
}

.ticSite {
    word-break: break-all;
}

.ticSite a {
    color: var(--mint-teal);
    font-size: 0.82rem;
}

.ticSite .url-verified {
    color: #28a745;
}

.ticSite .url-unverified {
    color: #6c757d;
}

/* Description */
.ticDescription {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
    position: relative;
    margin-top: 8px;
    margin-bottom: 4px;
}

.ticDescription::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
}

/* Social networks */
.ticSocials {
    margin-top: 6px;
    font-size: 0.82rem;
}

.ticSocials a {
    margin-right: 6px;
}

/* Registry number badge */
.reestrNumberDiv {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background-color: var(--orange);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

/* Status badges */
.tic-badge-naito {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(231, 111, 81, 0.1);
    color: var(--coral-dark);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(231, 111, 81, 0.3);
    margin-right: 4px;
    margin-top: 4px;
}

.tic-badge-best {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(240, 192, 64, 0.1);
    color: #8a6800;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(240, 192, 64, 0.4);
    margin-right: 4px;
    margin-top: 4px;
}

.tic-badge-rtc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(42, 157, 143, 0.1);
    color: var(--mint-teal);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(42, 157, 143, 0.3);
    margin-right: 4px;
    margin-top: 4px;
}

.tic-badges-row {
    margin-bottom: 6px;
}

/* Card actions */
.tic-card-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--card-border);
}

.btn-tic-detail {
    font-size: 0.8rem;
    color: var(--mint-teal);
    border: 1px solid var(--mint-teal);
    border-radius: 6px;
    padding: 4px 12px;
    transition: all 0.2s;
    background: transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-tic-detail:hover {
    background-color: var(--mint-teal);
    color: #fff;
    text-decoration: none;
}

/* =====================================================================
   Yandex Map
   ===================================================================== */

/* Fix Bootstrap box-sizing/img conflict with Yandex Maps 2.x.
   Bootstrap sets * { box-sizing: border-box } globally — this breaks ymaps controls
   (zoom buttons, geolocation) which rely on content-box sizing.
   Scoping by map container IDs overrides Bootstrap with higher specificity. */
#mapDetail *,
#mapDetail *::before,
#mapDetail *::after,
#map *,
#map *::before,
#map *::after,
#mapFull *,
#mapFull *::before,
#mapFull *::after,
#mapFullPage *,
#mapFullPage *::before,
#mapFullPage *::after {
    box-sizing: content-box !important;
}
#mapDetail img,
#map img,
#mapFull img,
#mapFullPage img {
    max-width: none !important;
    height: auto;
    vertical-align: baseline;
}

#map,
#mapFull,
.tic-map {
    height: 500px;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    overflow: hidden;
    background-color: var(--light-bg);
}

#mapDetail {
    height: 380px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

/* =====================================================================
   Detail Page
   ===================================================================== */

.tic-detail-logo {
    max-width: 200px;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    background-color: var(--light-bg);
    padding: 8px;
    border: 1px solid var(--card-border);
    display: block;
    margin-bottom: 12px;
}

.tic-detail-logo-placeholder {
    width: 200px;
    height: 160px;
    border-radius: 8px;
    background-color: var(--light-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 12px;
}

.tic-detail-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--deep-indigo);
    margin-bottom: 8px;
}

.tic-detail-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.tic-detail-field i {
    color: var(--mint-teal);
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.tic-detail-field .field-label {
    font-weight: 600;
    color: var(--deep-indigo);
    min-width: 120px;
    flex-shrink: 0;
}

.tic-detail-table {
    font-size: 0.875rem;
}

.tic-detail-table th {
    color: var(--deep-indigo);
    font-weight: 600;
    padding: 8px 12px;
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--card-border);
}

.tic-detail-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: top;
}

/* Info Points */
.infopoint-card {
    background-color: var(--light-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 0.875rem;
}

.infopoint-card .ip-name {
    font-weight: 600;
    color: var(--deep-indigo);
    margin-bottom: 4px;
}

.infopoint-card .ip-field {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 3px;
    color: #555;
}

.infopoint-card .ip-field i {
    color: #4a90d9;
    margin-top: 2px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

/* =====================================================================
   Breadcrumb
   ===================================================================== */

.navLinks {
    margin-bottom: 1.25rem;
}

.navLinks .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.82rem;
}

.navLinks .breadcrumb-item a {
    color: var(--mint-teal);
}

.navLinks .breadcrumb-item.active {
    color: var(--text-muted-custom);
}

/* =====================================================================
   Section titles
   ===================================================================== */

.tic-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--deep-indigo);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--mint-teal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tic-section-title i {
    color: var(--mint-teal);
}

/* =====================================================================
   Widget Page
   ===================================================================== */

.widget-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 13px;
    background: #fff;
    color: #333;
    margin: 0;
    padding: 8px;
}

.widget-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.widget-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.widget-table .w-logo {
    width: 50px;
    text-align: center;
}

.widget-table .w-logo img {
    max-width: 46px;
    max-height: 40px;
    object-fit: contain;
}

.widget-table .w-name a {
    font-weight: 600;
    color: #1a1a4e;
    text-decoration: none;
}

.widget-table .w-name a:hover {
    color: #2a9d8f;
}

.widget-table .w-region {
    color: #888;
    font-size: 11px;
}

.widget-table .w-contacts {
    font-size: 11px;
    color: #555;
}

/* =====================================================================
   GetWidgetCode / GetBadgeCode Pages
   ===================================================================== */

.code-box {
    background-color: #1e1e2e;
    color: #cdd6f4;
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 80px;
}

.code-box textarea {
    width: 100%;
    background: transparent;
    color: #cdd6f4;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    resize: vertical;
    min-height: 80px;
}

.code-copy-btn {
    font-size: 0.8rem;
    padding: 4px 12px;
    background-color: var(--mint-teal);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.code-copy-btn:hover {
    background-color: var(--mint-teal-light);
}

.badge-preview-box {
    text-align: center;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    margin-bottom: 16px;
}

/* =====================================================================
   LastUpdates Page (DataTables)
   ===================================================================== */

.tic-datatable-wrapper .dt-container {
    font-size: 0.875rem;
}

.tic-datatable-wrapper table thead th {
    background-color: var(--deep-indigo);
    color: #fff;
    font-weight: 600;
    padding: 10px 12px;
}

.tic-datatable-wrapper table tbody tr:hover {
    background-color: rgba(42, 157, 143, 0.06);
}

.tic-registry-num {
    display: inline-block;
    background-color: var(--orange);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* =====================================================================
   MapOnly Page
   ===================================================================== */

#mapFullPage {
    height: calc(100vh - 160px);
    min-height: 500px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
}

.maponly-sidebar {
    height: calc(100vh - 160px);
    min-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: #fff;
}

.maponly-sidebar-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--card-border);
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 0.82rem;
}

.maponly-sidebar-item:hover {
    background-color: rgba(42, 157, 143, 0.08);
}

.maponly-sidebar-item .item-name {
    font-weight: 600;
    color: var(--deep-indigo);
    margin-bottom: 2px;
}

.maponly-sidebar-item .item-region {
    color: var(--text-muted-custom);
    font-size: 0.78rem;
}

/* =====================================================================
   Footer
   ===================================================================== */

.tic-footer {
    background-color: var(--deep-indigo);
    color: rgba(255, 255, 255, 0.75);
    padding: 24px 0;
    font-size: 0.82rem;
    line-height: 1.6;
}

.tic-footer a {
    color: rgba(255, 255, 255, 0.85);
}

.tic-footer a:hover {
    color: var(--coral);
    text-decoration: none;
}

.tic-footer .text-muted {
    color: rgba(255, 255, 255, 0.45) !important;
}

/* =====================================================================
   Verified / Unverified URL tags
   ===================================================================== */

.url-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    padding: 2px 7px;
    border-radius: 8px;
    margin-right: 4px;
    margin-bottom: 3px;
}

.url-tag.verified {
    background-color: rgba(40, 167, 69, 0.1);
    color: #1a7c38;
    border: 1px solid rgba(40, 167, 69, 0.25);
}

.url-tag.unverified {
    background-color: rgba(108, 117, 125, 0.1);
    color: #666;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 767.98px) {
    .pagecontainer {
        padding: 16px;
        border-radius: 8px;
        margin-top: 10px;
    }

    .ticLogoCol {
        display: none;
    }

    #map,
    #mapFull,
    .tic-map {
        height: 300px;
    }

    .reestrNumberDiv {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    .tic-page-header h1,
    .tic-page-header h3 {
        font-size: 1.15rem;
    }
}

@media (max-width: 575.98px) {
    .tic-navbar-brand {
        font-size: 0.95rem;
    }
}
