/**
 * KATS Training - Custom Stylesheet
 * Version: 1.0
 *
 * Custom styles to complement Bootstrap 5 and match brand guidelines.
 */

/* ============================================================================
   VARIABLES & CUSTOM PROPERTIES
   ============================================================================ */

:root {
    /* Brand Colors */
    --primary-navy: #1a2332;
    --primary-teal: #06BBCC;
    --primary-teal-dark: #0593a0;

    /* Neutral Colors */
    --white: #FFFFFF;
    --light-gray: #F8F9FA;
    --dark-gray: #343A40;
    --medium-gray: #6C757D;

    /* Accent Colors */
    --success-green: #28A745;
    --warning-orange: #FFC107;
    --danger-red: #DC3545;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

body {
    font-family: var(--font-family);
    color: var(--dark-gray);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-navy);
}

/* ============================================================================
   BOOTSTRAP OVERRIDES
   ============================================================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
    border: none;
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-teal-dark) 0%, var(--primary-teal) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 187, 204, 0.3);
}

.text-primary {
    color: var(--primary-teal) !important;
}

.bg-primary {
    background-color: var(--primary-navy) !important;
}

.btn-outline-primary {
    border-color: var(--primary-teal);
    color: var(--primary-teal);
}

.btn-outline-primary:hover {
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
}

/* ============================================================================
   SECTION TITLES
   ============================================================================ */

.section-title {
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

.section-title.bg-white::before,
.section-title.bg-white::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 50px;
    height: 2px;
    background: var(--primary-teal);
}

.section-title.bg-white::before {
    right: 100%;
    margin-right: 15px;
}

.section-title.bg-white::after {
    left: 100%;
    margin-left: 15px;
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.navbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.navbar-light .navbar-nav .nav-link {
    color: var(--dark-gray);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-teal);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   CARDS & SERVICE ITEMS
   ============================================================================ */

.service-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.service-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-item {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.course-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================================================
   TESTIMONIALS
   ============================================================================ */

.testimonial-item {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.testimonial-img {
    border: 4px solid var(--primary-teal);
}

/* ============================================================================
   TEAM MEMBERS
   ============================================================================ */

.team-item {
    transition: transform var(--transition-normal);
}

.team-item:hover {
    transform: translateY(-4px);
}

/* ============================================================================
   PARTNERS CAROUSEL
   ============================================================================ */

.partner-carousel .partner-item img,
.partner-logo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all var(--transition-normal);
}

.partner-carousel .partner-item:hover img,
.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ============================================================================
   FLOATING CONTACT BUTTONS
   ============================================================================ */

.floating-contact-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    color: white;
}

.whatsapp-btn {
    background-color: #25D366;
}

.phone-btn {
    background-color: #0088cc;
}

.email-btn {
    background-color: #EA4335;
}

.pdf-btn {
    background-color: #DC3545;
}

/* Mobile: Stack horizontally at bottom */
@media (max-width: 768px) {
    .floating-contact-buttons {
        bottom: 10px;
        right: 10px;
        left: 10px;
        flex-direction: row;
        justify-content: space-around;
        background: rgba(255, 255, 255, 0.95);
        padding: 10px;
        border-radius: 25px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* ============================================================================
   BACK TO TOP BUTTON
   ============================================================================ */

.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 80px;
        right: 50%;
        transform: translateX(50%);
    }
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 0.2rem rgba(6, 187, 204, 0.1);
}

.form-check-input:checked {
    background-color: var(--primary-teal);
    border-color: var(--primary-teal);
}

/* ============================================================================
   SOCIAL BUTTONS
   ============================================================================ */

.btn-social {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--primary-navy) !important;
}

.footer .btn-link {
    display: block;
    padding: 0;
    margin-bottom: 8px;
    font-weight: normal;
    color: #DDDDDD;
    text-decoration: none;
    transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer .btn-link:hover {
    color: var(--primary-teal);
    padding-left: 10px;
}

.footer .btn-link::before {
    content: "\f105";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 8px;
}

/* ============================================================================
   SPINNER/LOADING
   ============================================================================ */

#spinner {
    background: rgba(255, 255, 255, 0.95);
}

#spinner.show {
    opacity: 1;
}

/* ============================================================================
   PAGE HEADER
   ============================================================================ */

.page-header {
    background-color: var(--primary-navy);
    margin-bottom: 3rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* ============================================================================
   OWL CAROUSEL CUSTOMIZATION
   ============================================================================ */

.owl-carousel .owl-nav button {
    width: 40px;
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--primary-teal) !important;
    color: white !important;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.owl-carousel .owl-nav button:hover {
    background: var(--primary-teal-dark) !important;
}

.owl-carousel .owl-dots .owl-dot span {
    background: var(--medium-gray) !important;
}

.owl-carousel .owl-dots .owl-dot.active span {
    background: var(--primary-teal) !important;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.shadow-sm-hover {
    transition: box-shadow var(--transition-normal);
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--primary-teal-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================================
   MEGA MENU STYLES
   ============================================================================ */

/* Desktop Mega Menu */
.mega-menu-dropdown {
    position: static !important;
}

.mega-menu-content {
    width: 100%;
    left: 0;
    right: 0;
    padding: 1.5rem 0;
    border: none;
    border-top: 3px solid var(--primary-teal);
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: var(--white);
}

.mega-menu-col {
    padding: 0 1rem;
    border-right: 1px solid #eee;
}

.mega-menu-col:last-child {
    border-right: none;
}

.mega-menu-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.mega-menu-title a {
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.mega-menu-title a:hover {
    opacity: 0.8;
}

.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    margin-bottom: 0.5rem;
}

.mega-menu-list li a {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.mega-menu-list li a:hover {
    background: var(--light-gray);
    color: var(--primary-teal);
    padding-left: 0.75rem;
}

.mega-menu-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.mega-menu-view-all {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-teal);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.mega-menu-view-all:hover {
    color: var(--primary-teal-dark);
}

.mega-menu-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    text-align: center;
}

/* Hover trigger for desktop */
@media (min-width: 992px) {
    .mega-menu-dropdown:hover .mega-menu-content {
        display: block;
    }

    .mega-menu-dropdown .dropdown-toggle::after {
        transition: transform var(--transition-fast);
    }

    .mega-menu-dropdown:hover .dropdown-toggle::after {
        transform: rotate(180deg);
    }
}

/* Mobile Programmes Menu */
.mobile-prog-menu {
    background: var(--light-gray);
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
}

.mobile-prog-menu .accordion-item {
    border: none;
    background: transparent;
    margin-bottom: 0.5rem;
}

.mobile-prog-menu .accordion-button {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--white);
    border-radius: 6px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mobile-prog-menu .accordion-button:not(.collapsed) {
    background: var(--white);
    color: var(--primary-teal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-prog-menu .accordion-button:focus {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mobile-prog-menu .accordion-body {
    padding: 0.75rem;
    background: var(--white);
    border-radius: 0 0 6px 6px;
    margin-top: -4px;
}

.mobile-prog-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.mobile-prog-link:hover {
    background: var(--light-gray);
    color: var(--primary-teal);
}

.mobile-prog-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 0.5rem;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 991px) {
    .navbar-brand {
        padding: 15px 20px !important;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .display-3 {
        font-size: 2.5rem;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

/* ============================================================================
   VIDEO SECTION
   ============================================================================ */

.video-card {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(6, 187, 204, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-play-btn i {
    color: #fff;
    font-size: 20px;
    margin-left: 3px;
}

.video-card:hover .video-play-btn {
    background: var(--primary-teal);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    padding: 15px 20px;
}

.video-info h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-navy);
}

.video-info p {
    font-size: 13px;
    color: var(--medium-gray);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Modal */
.video-modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.video-modal .modal-body video {
    display: block;
    border-radius: 0 0 12px 12px;
}

/* Portrait video modal - narrower on desktop, capped height */
.video-modal-portrait {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.video-modal-portrait .modal-body video {
    max-height: 75vh;
    width: 100%;
    object-fit: contain;
}

/* On mobile, portrait modals can use more width */
@media (max-width: 576px) {
    .video-modal-portrait {
        max-width: 92%;
    }
}

@media print {
    .navbar,
    .footer,
    .floating-contact-buttons,
    .back-to-top {
        display: none !important;
    }
}

/* ============================================================================
   PWA INSTALL BANNER
   ============================================================================ */

.pwa-install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a2332 0%, #2d3a4d 100%);
    color: #fff;
    padding: 12px 15px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-install-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-install-icon {
    font-size: 24px;
    color: var(--primary-teal);
}

.pwa-install-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.pwa-install-text strong {
    font-size: 14px;
    font-weight: 600;
}

.pwa-install-text span {
    font-size: 12px;
    opacity: 0.85;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-install-button {
    background: var(--primary-teal);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-install-button:hover {
    background: var(--primary-teal-dark);
    transform: scale(1.05);
}

.pwa-install-close {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.pwa-install-close:hover {
    opacity: 1;
}

.pwa-ios-instructions {
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.pwa-ios-instructions p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.pwa-ios-instructions i {
    color: var(--primary-teal);
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .pwa-install-banner {
        padding: 10px;
    }

    .pwa-install-content {
        gap: 10px;
    }

    .pwa-install-icon {
        font-size: 20px;
    }

    .pwa-install-text strong {
        font-size: 13px;
    }

    .pwa-install-text span {
        font-size: 11px;
    }

    .pwa-install-button {
        padding: 6px 15px;
        font-size: 13px;
    }
}

/* Hide banner when app is installed */
@media (display-mode: standalone) {
    .pwa-install-banner {
        display: none !important;
    }
}
