/* Дополнительные стили для проекта */

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Базовые стили */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Предотвращение мигания темы */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Предзагрузка темы для предотвращения мигания */
html {
    color-scheme: light dark;
}

main {
    flex: 1 0 auto;
}

/* Navbar стили */
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: var(--bs-primary);
}

/* Theme Toggle Button в Navbar */
.navbar .btn.nav-link {
    background: none;
    border: none;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.navbar .btn.nav-link:hover {
    background: none;
    transform: scale(1.1);
}

.navbar .btn.nav-link i {
    font-size: 1.1rem;
}

/* Скрываем текст темы на больших экранах */
@media (min-width: 992px) {
    .navbar .btn.nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Cards */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero .lead {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.hero-decoration {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 400px;
    height: 400px;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    opacity: 0.5;
    z-index: -1;
}

/* Tool Cards */
.tool-card {
    border: 2px solid var(--bs-border-color);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--bs-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-icon {
    width: 64px;
    height: 64px;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.tool-icon i {
    color: var(--bs-primary);
}

.tool-card.warning .tool-icon {
    background-color: rgba(255, 193, 7, 0.1);
}

.tool-card.warning .tool-icon i {
    color: var(--bs-warning);
}

.tool-card.success .tool-icon {
    background-color: rgba(25, 135, 84, 0.1);
}

.tool-card.success .tool-icon i {
    color: var(--bs-success);
}

.tool-card.danger .tool-icon {
    background-color: rgba(220, 53, 69, 0.1);
}

.tool-card.danger .tool-icon i {
    color: var(--bs-danger);
}

.tool-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.tool-card p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Features */
.features-section {
    padding: 5rem 0;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--bs-primary);
}

.feature-item h5 {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-item p {
    font-size: 0.95rem;
}

/* Stats Section */
.stats-section {
    background-color: var(--bs-primary);
    color: white;
    padding: 3rem 0;
    margin: 5rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Section Title */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
}

/* Badge */
.badge-new {
    background-color: var(--bs-success);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
}

.btn-coming-soon {
    background-color: var(--bs-secondary);
    color: white;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Footer */
footer {
    border-top: 1px solid var(--bs-border-color);
    padding: 3rem 0;
    margin-top: 5rem;
}

/* Risk Map Styles */
.risk-map-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.risk-map {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 600px;
    margin: 0 auto;
    border: 3px solid #34495e;
    border-radius: 10px;
    overflow: hidden;
}

.risk-zone {
    position: absolute;
    border: 1px dashed rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
}

.low-risk {
    background-color: rgba(39, 174, 96, 0.3);
}

.medium-risk {
    background-color: rgba(243, 156, 18, 0.3);
}

.critical-risk {
    background-color: rgba(231, 76, 60, 0.3);
}

.risk-point {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.risk-point:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

.risk-point.low {
    background: #27ae60;
}

.risk-point.medium {
    background: #f39c12;
}

.risk-point.critical {
    background: #e74c3c;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    /* Навигация */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem;
    }
    
    /* Кнопка темы на мобильных */
    .navbar .btn.nav-link {
        padding: 0.5rem 0.75rem !important;
        margin: 0;
        border: none;
        background: none !important;
        color: var(--bs-nav-link-color) !important;
        text-align: left;
        width: 100%;
        justify-content: flex-start;
    }
    
    .navbar .btn.nav-link:hover {
        color: var(--bs-nav-link-hover-color) !important;
        background: none !important;
    }
    
    .navbar .btn.nav-link i {
        font-size: 1.1rem;
        margin-right: 0.5rem;
    }
    
    /* Навбар на мобильных - полная ширина для элементов */
    .navbar-collapse .navbar-nav {
        width: 100%;
    }
    
    .navbar-collapse .nav-item {
        width: 100%;
    }
    
    .navbar-collapse .nav-link {
        width: 100%;
        text-align: left;
    }
    
    /* Регистрация кнопка в collapse */
    .navbar-collapse .btn-primary {
        margin-top: 0.5rem;
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    /* Hero секция */
    .hero {
        padding: 3rem 0;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.2rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .hero .lead {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .hero .btn.me-3 {
        margin-right: 0 !important;
    }
    
    /* Карточки инструментов */
    .tool-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
        text-align: center;
    }
    
    .tool-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin: 0 auto 1rem;
    }
    
    .tool-card h4 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .tool-card p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }
    
    /* Секция статистики */
    .stats-section {
        padding: 2rem 0;
        margin: 2.5rem 0;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* Секция возможностей */
    .features-section {
        padding: 3rem 0;
    }
    
    .feature-item {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .feature-icon {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .feature-item h5 {
        font-size: 1.1rem;
    }
    
    .feature-item p {
        font-size: 0.9rem;
    }
    
    /* Section titles */
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 0;
        margin-top: 3rem;
    }
    
    footer .col-md-4 {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* Карта рисков */
    .risk-map-container {
        padding: 15px;
        margin: 1rem;
    }
    
    .risk-map {
        height: 400px;
    }
}

@media (max-width: 576px) {
    /* Дополнительные стили для очень маленьких экранов */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero .lead {
        font-size: 1rem;
    }
    
    .tool-card {
        padding: 1.25rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    /* Профиль пользователя */
    .card-body.p-5 {
        padding: 2rem !important;
    }
    
    /* Статистические карточки профиля */
    .col-sm-6.col-md-3 {
        margin-bottom: 1rem;
    }
    
    .col-sm-6.col-md-3 .card-body {
        padding: 1.5rem !important;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto 1rem;
    }
    
    /* Формы */
    .card.shadow-soft {
        margin: 1rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    /* Ганта диаграмма */
    .gantt-preview {
        width: 100%;
        height: 250px;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .stats-section {
        padding: 1.5rem 0;
        margin: 2rem 0;
    }
}

/* Улучшения для сенсорных устройств */
@media (hover: none) and (pointer: coarse) {
    /* Увеличенные области касания */
    .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tool-card {
        padding: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .tool-card:hover {
        transform: none;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    }
    
    /* Убираем hover эффекты на сенсорных */
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Улучшенное касание для кнопки темы */
    .navbar .btn.nav-link {
        min-width: 44px;
        min-height: 44px;
        border-radius: 8px;
        margin: 0.25rem;
    }
}

/* Адаптация для планшетов */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .tool-card {
        padding: 1.75rem;
    }
    
    .tool-icon {
        width: 60px;
        height: 60px;
    }
    
    .container {
        max-width: 90%;
    }
}

/* Темная тема - минимальные переопределения для кастомных элементов */
[data-bs-theme="dark"] .hero-decoration {
    background-color: rgba(13, 110, 253, 0.05);
}

[data-bs-theme="dark"] .tool-icon {
    background-color: rgba(13, 110, 253, 0.2);
}

[data-bs-theme="dark"] .tool-card.warning .tool-icon {
    background-color: rgba(255, 193, 7, 0.2);
}

[data-bs-theme="dark"] .tool-card.success .tool-icon {
    background-color: rgba(25, 135, 84, 0.2);
}

[data-bs-theme="dark"] .tool-card.danger .tool-icon {
    background-color: rgba(220, 53, 69, 0.2);
}

[data-bs-theme="dark"] .feature-icon {
    background-color: rgba(13, 110, 253, 0.2);
}

[data-bs-theme="dark"] .risk-zone {
    color: rgba(255, 255, 255, 0.6);
}