/*
 * Index Page Specific Styles
 * Перенесені inline стилі з index.html
 */

/* ========================
   MOBILE NAVIGATION COLORS
   ======================== */

/* Максимальна специфічність для перекриття mobile-pwa.css */
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item i.text-primary,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[href*="map"] i {
    color: #0d6efd !important;
}

html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item i.text-warning,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[href*="my-registry"] i {
    color: #ffc107 !important;
}

html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item i.text-success,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[href*="notes"] i,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[href*="register"] i {
    color: #198754 !important;
}

html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item i.text-info,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[href*="resources"] i,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[href*="login"] i {
    color: #0dcaf0 !important;
}

html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item i.text-secondary,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[href*="cabinet"] i {
    color: #6c757d !important;
}

html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item i.text-danger,
html body nav.mobile-bottom-nav .mobile-nav-item.dropdown .dropdown-menu .dropdown-item[onclick*="logout"] i {
    color: #dc3545 !important;
}

/* ========================
   DATA FRESHNESS INDICATORS
   ======================== */

#dashboard-last-update .data-freshness-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.3s ease;
}

#dashboard-last-update .data-freshness-indicator.fresh {
    background: linear-gradient(45deg, #28a745, #34ce57);
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.5);
    animation: pulse-fresh 2s ease-in-out infinite;
}

#dashboard-last-update .data-freshness-indicator.stale {
    background: linear-gradient(45deg, #ffc107, #ffdc3d);
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.5);
}

#dashboard-last-update .data-freshness-indicator.outdated {
    background: linear-gradient(45deg, #dc3545, #e55467);
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.5);
    animation: pulse-outdated 1.5s ease-in-out infinite;
}

@keyframes pulse-fresh {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes pulse-outdated {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

#dashboard-last-update {
    color: #6c757d;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

#dashboard-last-update:has(.data-freshness-indicator.outdated) {
    color: #dc3545;
}

#dashboard-last-update:has(.data-freshness-indicator.fresh) {
    color: #28a745;
}

/* ========================
   REFRESH BUTTON STYLES
   ======================== */

.refresh-btn {
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.refresh-btn:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.refresh-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.refresh-btn.updating {
    background: linear-gradient(45deg, #28a745, #34ce57);
    animation: updating-pulse 1s ease-in-out infinite;
    pointer-events: none;
}

.refresh-btn.updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes updating-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================
   HERO SECTION STYLING
   ======================== */

.bg-light.py-5 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* ========================
   CACHE INFO SECTION
   ======================== */

.cache-info {
    background: rgba(248, 249, 250, 0.8);
    border-top: 1px solid rgba(222, 226, 230, 0.5);
    margin-top: 2rem;
}

.cache-info .btn {
    font-size: 0.875rem;
}

.cache-info small {
    opacity: 0.8;
}

/* ========================
   LEGACY COMPANY CARDS
   ======================== */

/* Стилі для старих карток компаній (для сумісності) */
.progress-comparison-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.progress-comparison-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.progress-card-header {
    margin-bottom: 1rem;
}

.progress-company-name {
    font-weight: 600;
    font-size: 1.125rem;
    color: #212529;
    margin-bottom: 0.25rem;
}

.progress-edrpou {
    font-size: 0.875rem;
    color: #6c757d;
}

.difference-indicator-top {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.difference-indicator-top.perfect {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.difference-indicator-top.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.difference-indicator-top.info {
    background: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border: 1px solid rgba(23, 162, 184, 0.2);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.progress-label-left,
.progress-label-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dual-progress-container {
    margin-bottom: 1rem;
}

.dual-progress-bar {
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    position: relative;
}

.progress-segment-rrp {
    background: linear-gradient(90deg, #007bff, #0056b3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    position: relative;
}

.progress-segment-dzk {
    background: linear-gradient(90deg, #28a745, #1e7e34);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    position: relative;
}

.progress-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    z-index: 10;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.progress-detail-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.progress-percentage {
    font-weight: 600;
}

.mismatch-details {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

/* ========================
   RESPONSIVE ADJUSTMENTS
   ======================== */

@media (max-width: 767.98px) {
    .progress-comparison-card {
        padding: 1rem;
    }
    
    .progress-company-name {
        font-size: 1rem;
    }
    
    .progress-labels {
        font-size: 0.8rem;
    }
    
    .dual-progress-bar {
        height: 20px;
    }
    
    .progress-segment-rrp,
    .progress-segment-dzk {
        font-size: 0.7rem;
    }
    
    .progress-details {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* ========================
   ACCESSIBILITY
   ======================== */

@media (prefers-reduced-motion: reduce) {
    .refresh-btn,
    .progress-comparison-card,
    #dashboard-last-update .data-freshness-indicator {
        transition: none;
    }
    
    .refresh-btn.updating::after,
    .pulse-fresh,
    .pulse-outdated {
        animation: none;
    }
}
