/**
 * NACHI Public Website Custom Styles
 * Overrides Apexa template colors and adds NACHI-specific components
 */

/* ============================================
   NACHI Brand Colors & Apexa Template Overrides
   ============================================ */
:root {
    --nachi-primary: #ed1b2e;
    --nachi-primary-hover: #7a1519;
    --nachi-text: #2f2f30;
    --nachi-text-light: #686868;
    --nachi-border: #E1E1E1;
    
    /* Override Apexa template primary colors with NACHI red */
    --tg-theme-primary-500: #ed1b2e;
    --tg-theme-primary-600: #7a1519;
    --tg-theme-primary-700: #5d1014;
    
    /* Override Apexa template secondary colors (menu active/hover) with NACHI red */
    --tg-theme-secondary-500: #ed1b2e;
    --tg-theme-secondary-600: #7a1519;
    --tg-theme-secondary-700: #5d1014;
}

/* Dark theme support */
[data-bs-theme="dark"] {
    --nachi-primary: #c42a30;
    --nachi-primary-hover: #ed1b2e;
    --nachi-text: #e0e0e0;
    --nachi-text-light: #b0b0b0;
    --nachi-border: #404040;
    
    /* Override Apexa template primary colors for dark mode */
    --tg-theme-primary-500: #c42a30;
    --tg-theme-primary-600: #ed1b2e;
    --tg-theme-primary-700: #7a1519;
    
    /* Override Apexa template secondary colors for dark mode */
    --tg-theme-secondary-500: #ed1b2e;
    --tg-theme-secondary-600: #ed1b2e;
    --tg-theme-secondary-700: #7a1519;
}

/* ============================================
   Dark/Light Theme Switcher - NACHI Red Override
   ============================================ */
.dark-light-switcher {
    width: 50px !important;
    height: 50px !important;
    background: var(--nachi-primary) !important;
    background-color: var(--nachi-primary) !important;
    border: none !important;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
}

.dark-light-switcher:hover {
    background: var(--nachi-primary-hover) !important;
    background-color: var(--nachi-primary-hover) !important;
    transform: scale(1.05);
    color: #ffffff !important;
}

.dark-light-switcher .theme-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #ffffff !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dark-light-switcher .theme-icon i {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dark-light-switcher {
    background: var(--nachi-primary) !important;
    background-color: var(--nachi-primary) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .dark-light-switcher:hover {
    background: var(--nachi-primary-hover) !important;
    background-color: var(--nachi-primary-hover) !important;
    color: #ffffff !important;
}

/* Override Apexa template's dark-light-switcher styles */
.tgmenu__action > .list-wrap li.header-btn .dark-light-switcher,
.tgmenu__action-two > .list-wrap li.header-btn .dark-light-switcher,
.tgmenu__action-three > .list-wrap li.header-btn .dark-light-switcher,
.tgmenu__action-five .list-wrap li.header-btn .dark-light-switcher {
    background: var(--nachi-primary) !important;
    background-color: var(--nachi-primary) !important;
    color: #ffffff !important;
}

.tgmenu__action > .list-wrap li.header-btn .dark-light-switcher:hover,
.tgmenu__action-two > .list-wrap li.header-btn .dark-light-switcher:hover,
.tgmenu__action-three > .list-wrap li.header-btn .dark-light-switcher:hover,
.tgmenu__action-five .list-wrap li.header-btn .dark-light-switcher:hover {
    background: var(--nachi-primary-hover) !important;
    background-color: var(--nachi-primary-hover) !important;
    color: #ffffff !important;
}

/* Light mode: show moon icon (to switch to dark) */
.dark-light-switcher .fa-sun {
    display: none;
    opacity: 0;
}

.dark-light-switcher .fa-moon {
    display: block;
    opacity: 1;
}

/* Dark mode: show sun icon (to switch to light) */
[data-bs-theme="dark"] .dark-light-switcher .fa-sun {
    display: block;
    opacity: 1;
}

[data-bs-theme="dark"] .dark-light-switcher .fa-moon {
    display: none;
    opacity: 0;
}

/* ============================================
   Menu Colors - NACHI Red
   ============================================ */
/* Override Apexa menu colors with NACHI red */
.tgmenu__navbar-wrap > ul > li.active a,
.tgmenu__navbar-wrap > ul > li:hover a {
    color: var(--nachi-primary) !important;
}

.tgmenu__main-menu li.menu-item-has-children > a:hover,
.tgmenu__main-menu li.menu-item-has-children:hover > a::after,
.tgmenu__main-menu li.menu-item-has-children.active > a::after {
    color: var(--nachi-primary) !important;
}

.tgmenu__navbar-wrap > ul > li .sub-menu > li:hover > a,
.tgmenu__navbar-wrap > ul > li .sub-menu > li.active > a {
    color: var(--nachi-primary) !important;
}

.tgmenu__navbar-wrap > ul > li .sub-menu > li:hover > a {
    color: var(--nachi-primary) !important;
}

/* Mobile menu active colors */
.tgmobile__menu .navigation li.active > a {
    color: var(--nachi-primary) !important;
}

/* ============================================
   Logo - White version for dark mode
   ============================================ */
.logo img,
.logo-img,
.fw-logo img,
.fw-logo .logo-img {
    transition: filter 0.3s ease;
}

/* Dark mode: invert logo to white */
[data-bs-theme="dark"] .logo img,
[data-bs-theme="dark"] .logo-img,
[data-bs-theme="dark"] .fw-logo img,
[data-bs-theme="dark"] .fw-logo .logo-img {
    filter: brightness(0) invert(1);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-nachi-primary {
    color: var(--nachi-primary) !important;
}

.bg-nachi-primary {
    background-color: var(--nachi-primary) !important;
}

.border-nachi-primary {
    border-color: var(--nachi-primary) !important;
}

/* ============================================
   Robot Card Styles (Custom Component)
   ============================================ */
.robot-card {
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.robot-card:hover {
    border-color: var(--nachi-primary);
    box-shadow: 0 8px 24px rgba(160, 29, 34, 0.12);
}

.robot-card .card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--nachi-primary);
    padding: 1rem 1.5rem;
}

.robot-card .card-title a {
    color: var(--nachi-text) !important;
    transition: color 0.3s ease;
}

.robot-card:hover .card-title a {
    color: var(--nachi-primary) !important;
}

.robot-card .card-body {
    display: flex;
    flex-direction: column;
}

.robot-card .btn-outline-primary {
    border-color: var(--nachi-primary) !important;
    color: var(--nachi-primary) !important;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

.robot-card .btn-outline-primary:hover {
    background-color: var(--nachi-primary) !important;
    color: #ffffff !important;
    transform: translateX(4px);
    opacity: 1 !important;
}

/* Dark mode support for robot card buttons */
[data-bs-theme="dark"] .robot-card .btn-outline-primary {
    border-color: var(--nachi-primary) !important;
    color: var(--nachi-primary) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

[data-bs-theme="dark"] .robot-card .btn-outline-primary:hover {
    background-color: var(--nachi-primary) !important;
    color: #ffffff !important;
    opacity: 1 !important;
}

/* ============================================
   Timeline Styles (Custom Component)
   ============================================ */
.timeline-label {
    position: relative;
    padding-left: 0;
}

.timeline-label:before {
    content: '';
    position: absolute;
    left: 100px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e4e6ef;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    display: flex;
    align-items: flex-start;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item .timeline-label {
    width: 100px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 1.5rem;
    position: relative;
    z-index: 1;
}

.timeline-item .timeline-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: #ffffff;
    border-radius: 50%;
}

.timeline-item .timeline-badge i {
    font-size: 1.5rem;
}

.timeline-item .timeline-content {
    flex: 1;
    padding-left: 1.5rem;
    min-width: 0;
}

@media (max-width: 767px) {
    .timeline-label:before {
        left: 50px;
    }
    
    .timeline-item .timeline-label {
        width: 50px;
        font-size: 0.875rem;
        padding-right: 1rem;
    }
    
    .timeline-item .timeline-badge {
        width: 30px;
        height: 30px;
    }
    
    .timeline-item .timeline-badge i {
        font-size: 1.25rem;
    }
    
    .timeline-item .timeline-content {
        padding-left: 1rem;
    }
}

/* ============================================
   Breadcrumb - NACHI Custom Style
   ============================================ */
.nachi-breadcrumb {
    position: relative;
    padding: 60px 0 50px !important;
    min-height: auto !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
}

.nachi-breadcrumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(160, 29, 34, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(160, 29, 34, 0.05) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(160, 29, 34, 0.02) 2px,
            rgba(160, 29, 34, 0.02) 4px
        );
    pointer-events: none;
}

.nachi-breadcrumb::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(160, 29, 34, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.nachi-breadcrumb .breadcrumb__content {
    position: relative;
    z-index: 1;
}

.nachi-breadcrumb .breadcrumb__content .title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--nachi-text);
    margin-bottom: 15px;
}

.nachi-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.nachi-breadcrumb .breadcrumb-item {
    color: var(--nachi-text-light);
}

.nachi-breadcrumb .breadcrumb-item a {
    color: var(--nachi-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nachi-breadcrumb .breadcrumb-item a:hover {
    color: var(--nachi-primary);
}

.nachi-breadcrumb .breadcrumb-item.active {
    color: var(--nachi-primary);
    font-weight: 600;
}

.nachi-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--nachi-text-light);
    padding: 0 10px;
}

/* Remove breadcrumb shapes */
.nachi-breadcrumb .breadcrumb__shape {
    display: none;
}

/* Dark mode support */
[data-bs-theme="dark"] .nachi-breadcrumb {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    background-size: 200% 200%;
}

[data-bs-theme="dark"] .nachi-breadcrumb::before {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(196, 42, 48, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(196, 42, 48, 0.08) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(196, 42, 48, 0.03) 2px,
            rgba(196, 42, 48, 0.03) 4px
        );
}

[data-bs-theme="dark"] .nachi-breadcrumb::after {
    background: radial-gradient(circle, rgba(196, 42, 48, 0.12) 0%, transparent 70%);
}

[data-bs-theme="dark"] .nachi-breadcrumb .breadcrumb__content .title {
    color: var(--nachi-text);
}

[data-bs-theme="dark"] .nachi-breadcrumb .breadcrumb-item,
[data-bs-theme="dark"] .nachi-breadcrumb .breadcrumb-item a {
    color: var(--nachi-text-light);
}

[data-bs-theme="dark"] .nachi-breadcrumb .breadcrumb-item.active {
    color: var(--nachi-primary);
}

/* ============================================
   Language Switcher - Header
   ============================================ */
.header-language {
    display: flex;
    align-items: center;
    position: relative;
}

/* Remove red background from language dropdown ::before pseudo-element */
.language-dropdown::before,
.header-language::before,
.header-language .language-dropdown-toggle::before,
.header-language .language-dropdown-menu::before,
.header-language .dropdown::before {
    display: none !important;
    content: none !important;
    background: none !important;
    background-color: transparent !important;
}

/* Override template hover effects for language dropdown */
.tgmenu__action ul li.header-language a:hover,
.tgmenu__action ul li.header-language button:hover,
.tgmenu__action ul li.header-language .language-dropdown-toggle:hover {
    color: inherit !important;
    background-color: transparent !important;
    opacity: 1 !important;
}

.header-language .language-dropdown-toggle {
    color: inherit !important;
    border: none !important;
    background: transparent !important;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    transition: none !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    opacity: 1 !important;
}

.header-language .language-dropdown-toggle:hover,
.header-language .language-dropdown-toggle:focus,
.header-language .language-dropdown-toggle:active {
    color: inherit !important;
    background-color: transparent !important;
    opacity: 1 !important;
    box-shadow: none !important;
    outline: none !important;
}

.header-language .language-dropdown-toggle span {
    opacity: 1 !important;
    color: inherit !important;
}

.header-language .language-dropdown-toggle:hover span,
.header-language .language-dropdown-toggle:focus span,
.header-language .language-dropdown-toggle:active span {
    opacity: 1 !important;
    color: inherit !important;
}

.header-language .language-dropdown-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.header-language .language-dropdown-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.header-language .language-dropdown-menu {
    min-width: 180px;
    border: 1px solid #f5f5f5;
    background: #ffffff;
    box-shadow: 0px 30px 70px 0px rgba(137, 139, 142, 0.15);
    border-radius: 6px;
    padding: 12px 0 8px;
    margin-top: 0;
    animation: fadeInDown 0.3s ease;
    display: none;
}

.header-language:hover .language-dropdown-menu,
.header-language:focus-within .language-dropdown-menu {
    display: block;
}

.header-language .language-dropdown-menu.show {
    display: block;
}

.header-language:hover .language-dropdown-toggle .fa-chevron-down,
.header-language:focus-within .language-dropdown-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-language .language-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    transition: all 0.3s ease;
    color: var(--nachi-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: transparent;
}

.header-language .language-item:hover {
    background-color: rgba(160, 29, 34, 0.08);
    color: var(--nachi-primary);
    transform: translateX(4px);
}

.header-language .language-item.active {
    background-color: rgba(160, 29, 34, 0.1);
    color: var(--nachi-primary);
    font-weight: 600;
}

.header-language .language-item.active .fa-check {
    color: var(--nachi-primary);
    font-size: 12px;
}

.header-language .language-item i:first-child {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
}

/* Mobile language switcher */
.mobile-language-switch {
    border-top: 1px solid var(--nachi-border);
    padding-top: 1rem;
}

.mobile-language-switch .language-dropdown-toggle {
    width: 100%;
    justify-content: center;
    border-color: var(--nachi-primary);
    color: var(--nachi-primary);
}

.mobile-language-switch .language-dropdown-toggle:hover {
    background-color: var(--nachi-primary);
    color: #ffffff;
}

.mobile-language-switch .dropdown-menu {
    width: 100%;
}

/* Dark mode support */
[data-bs-theme="dark"] .header-language .language-dropdown-toggle:hover {
    background-color: transparent !important;
    color: inherit !important;
}

[data-bs-theme="dark"] .header-language .language-dropdown-menu {
    background-color: #1a1a1a;
    border-color: #2d2d2d;
    box-shadow: 0px 30px 70px 0px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .header-language .language-item {
    color: var(--nachi-text);
}

[data-bs-theme="dark"] .header-language .language-item:hover {
    background-color: rgba(196, 42, 48, 0.15);
    color: var(--nachi-primary);
}

[data-bs-theme="dark"] .header-language .language-item.active {
    background-color: rgba(196, 42, 48, 0.2);
    color: var(--nachi-primary);
}

[data-bs-theme="dark"] .mobile-language-switch {
    border-top-color: var(--nachi-border);
}
