/* --- ЦВЕТА ПО УМОЛЧАНИЮ (ТЕМНАЯ ТЕМА) --- */
/* Используем прямые HEX-коды для максимальной стабильности в IE10/9 */
.dark-bg-color { background-color: #121212; }
.dark-header-bg { background-color: #1e1e1e; }
.dark-text-color { color: #ffffff; }
.dark-button-bg { background-color: #333333; }
.dark-button-hover { background-color: #444444; }
.dark-border-color { border-color: #333333; }
.dark-shadow-color { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.dark-accent-color { color: #ff0000; }
.dark-nav-bg { background-color: #252525; }

/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

/* CRITICAL для IE9/10: Убеждаемся, что новые HTML5 теги отображаются как блоки */
header, main, footer, nav, section, article, div {
    display: block;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    /* --- Flexbox: Основной контейнер страницы (IE10) --- */
    display: -ms-flexbox; 
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
}

a {
    color: #ff0000;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* HEADER */
header {
    background-color: #1e1e1e;
    color: #ffffff;
    padding: 1rem 2rem;
    /* --- Flexbox с префиксами для IE10 --- */
    display: -ms-flexbox;
    display: flex;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -ms-flex-align: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    border-bottom: 1px solid #333333;
}

.logo-icon {
    color: #ff0000;
    margin-right: 8px;
}
.logo {
    font-size: 1.2em;
    font-weight: bold;
}

.link {
  text-decoration: none;
}

/* Disable styles for links */

a {
  color: #ffffff; 
  text-decoration: none;
}

a:visited {
  color: #ffffff;
  text-decoration: none;
}

a:hover {
  color: #ffffff; 
  text-decoration: none; 
}

a:active {
  color: #ffff;
  text-decoration: none;
}


.nav-container {
    /* --- Flexbox с префиксами для IE10 --- */
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    margin-left: auto;
}

.nav-menu {
    /* --- Flexbox с префиксами для IE10 --- */
    display: -ms-flexbox;
    display: flex;
    margin-right: 1.5rem;
}

.nav-menu .nav-link {
    margin-right: 1.5rem;
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 0.2rem;
    position: relative;
    opacity: 0.8;
}

/* Remove browser default visited/focus/active purple and outlines for header links/logo */
.nav-menu .nav-link:visited,
.nav-menu .nav-link {
    color: #ffffff; /* keep consistent color for visited and normal */
}
.nav-menu .nav-link:focus,
.nav-menu .nav-link:active,
.logo:focus,
.logo:active,
.logo img:focus {
    outline: none;
    box-shadow: none;
}
.nav-menu .nav-link:visited { opacity: 0.8; }

/* Logo image sizing */
.logo-img{
    display:inline-block;
    width:24px;
    height:auto;
    vertical-align:middle;
    margin-right:8px;
}

.nav-menu .nav-link:last-child {
    margin-right: 0;
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
    color: #ff0000;
    text-decoration: none;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 2px;
    background-color: #ff0000;
}

/* Theme Toggle Button & Mobile Menu Button */
.theme-toggle, .mobile-menu-btn {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #555555;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 0.5rem;
    /* --- Flexbox с префиксами для IE10 --- */
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
}

.theme-toggle span {
    margin-right: 0.5rem;
}

.theme-toggle:hover, .mobile-menu-btn:hover {
    background-color: #444444;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    padding: 0.2rem 0.5rem;
    margin-right: 0;
}


/* MAIN CONTENT */
main {
    /* --- Flexbox: Занимает все доступное место (IE10) --- */
    -ms-flex-positive: 1; 
    flex-grow: 1;
    padding: 2rem 1rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

h1 {
    color: #ff0000;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #333333;
    padding-bottom: 0.5rem;
}

h2 {
    color: #ffffff;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.info-section {
    background-color: #252525;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.info-section strong {
    color: #ff0000;
    min-width: 150px;
    display: inline-block;
}

.link-button {
    display: inline-block;
    background-color: #ff0000;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
}

.link-button:hover {
    background-color: #cc0000;
    text-decoration: none;
}

.citation {
    margin-top: 2rem;
    padding: 1rem;
    border-top: 1px dashed #333333;
    font-size: 0.9rem;
    color: #888888;
    text-align: center;
}

.citation a {
    color: #ff0000;
    text-decoration: none;
}

/* FOOTER */
footer {
    background-color: #1e1e1e;
    color: #ffffff;
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #333333;
    font-size: 0.9rem;
    /* Свойство Flexbox для фиксации футера внизу */
    margin-top: 0;
}

/* --- СТИЛИ ДЛЯ IP-ТАБЛИЦЫ --- */
.ip-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    margin-bottom: 20px;
    background-color: #252525;
    border-radius: 4px;
    /* overflow: hidden; - Убрано, так как может ломать IE10 */
}

.ip-details-table td {
    padding: 10px 15px;
    border: 1px solid #333333;
    text-align: left;
}

.ip-details-table tr:first-child td {
    border-top: none;
}

.ip-details-table tr td:first-child {
    font-weight: bold;
    width: 35%;
    background-color: #333333;
}

#map-container {
    margin-top: 15px;
    text-align: center;
}


/* --- ПЕРЕОПРЕДЕЛЕНИЕ ЦВЕТОВ ДЛЯ СВЕТЛОЙ ТЕМЫ (IE10 compatible) --- */

html[data-theme="light"] body {
    background-color: #f5f5f5;
    color: #333333;
}

html[data-theme="light"] header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom-color: #cccccc;
}

html[data-theme="light"] .nav-link,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .mobile-menu-btn {
    color: #333333;
}

html[data-theme="light"] .logo-icon,
html[data-theme="light"] h1,
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .nav-link.active::after,
html[data-theme="light"] .info-section strong,
html[data-theme="light"] .citation a {
    color: #cc0000;
}

html[data-theme="light"] h1 {
    border-bottom-color: #cccccc;
}

html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .info-section {
    background-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .theme-toggle:hover {
    background-color: #d0d0d0;
}

html[data-theme="light"] footer {
    background-color: #ffffff;
    border-top-color: #cccccc;
    color: #333333;
}

html[data-theme="light"] .citation {
    border-top-color: #cccccc;
    color: #666666;
}

/* Стили для таблицы IP-информации */
html[data-theme="light"] .ip-details-table {
    background-color: #e0e0e0;
}

html[data-theme="light"] .ip-details-table td {
    border-color: #cccccc;
}

html[data-theme="light"] .ip-details-table tr td:first-child {
    background-color: #cccccc;
}


/* --- АДАПТИВНОСТЬ (MEDIA QUERIES) --- */

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #252525;
        
        /* --- Flexbox с префиксами для IE10 --- */
        -ms-flex-direction: column;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    }
    
    html[data-theme="light"] .nav-menu {
        background-color: #f0f0f0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu .nav-link {
        margin-right: 0;
        padding: 0.75rem 1rem;
    }
    
    .nav-menu.active {
        /* --- Flexbox с префиксами для IE10 --- */
        display: -ms-flexbox;
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .theme-toggle {
        margin-left: 0.5rem;
    }
}