/* Mobile Styles */
@media screen and (max-width: 767px) {
    /* Принудительные стили для предотвращения горизонтального скролла */
    html, 
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    * {
        max-width: 100vw;
        box-sizing: border-box !important;
    }

    .container,
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Header improvements */
    .main-header {
        padding: 10px 0;
        width: 100vw;
        left: 0;
        right: 0;
    }

    .navbar {
        padding: 0;
    }

    .navbar-brand {
        margin-right: 0;
        flex: 0 0 auto;
    }

    .logo {
        height: 25px;
        width: auto;
    }

    .navbar-toggler {
        padding: 6px;
        margin-left: auto;
        border: none;
        position: relative;
        z-index: 1000;
    }

    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(1, 3, 31, 0.98);
        padding: 60px 20px 20px;
        z-index: 999;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        height: 100vh;
        max-height: 600px;
    }

    .navbar-collapse.show {
        transform: translateX(0);
    }

    .navbar-nav {
        margin: 0;
        padding: 0;
        flex: 0.7;
    }

    .nav-item {
        margin: 10px 0;
        text-align: center;
    }

    .nav-link {
        font-size: 18px;
        padding: 10px 0 !important;
    }

    .main-header .social-links {
        margin-top: 20px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: center;
        gap: 25px;
    }

    .main-header .social-link img {
        height: 24px;
    }

    /* Footer improvements */
    .main-footer {
        padding: 40px 0 30px;
        overflow: hidden;
    }

    .footer-logo-top {
        margin-bottom: 30px;
    }

    .footer-logo-top img {
        height: 40px;
        width: auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 30px;
    }

    .footer-left h3 {
        font-size: 18px;
        margin-bottom: 15px;
        text-align: left;
    }

    .subscribe-form {
        display: flex;
        align-items: center;
        position: relative;
        max-width: 100%;
    }

    .subscribe-form .form-control {
        flex-grow: 1;
        height: 50px;
        padding-right: 145px; /* Space for the button */
    }

    .subscribe-form .btn {
        position: absolute;
        right: 5px;
        top: 5px;
        bottom: 5px;
        width: 130px;
        height: 40px;
        font-size: 0.9rem;
        padding: 0;
        min-width: auto;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .footer-links a {
        font-size: 12px;
        line-height: 1.4;
    }

    .footer-right {
        display: grid;
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .info-block {
        padding-bottom: 15px;
        text-align: left;
    }

    .info-block h4 {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .info-block p {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .info-block .social-links {
        justify-content: flex-start;
        gap: 20px;
    }

    .info-block .social-link {
        font-size: 14px;
    }

    .footer-bottom {
        padding-top: 20px;
        margin-top: 20px;
        text-align: center;
    }

    .footer-bottom p {
        font-size: 12px;
    }

    /* Credit card improvements */
    .program-card {
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 15px;
        width: 100%;
    }

    .program-card h3 {
        font-size: 18px;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .program-card .program-subtitle {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 15px;
    }

    .program-card .program-description {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .program-card .program-price {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 15px;
    }

    .program-card .program-duration {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .program-card .btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    /* General improvements */
    button,
    .btn,
    .nav-link,
    a {
        touch-action: manipulation;
    }

    input, 
    select, 
    textarea {
        font-size: 16px !important;
        border-radius: 8px;
        max-width: 100%;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* Row and column fixes */
    .row {
        margin-left: -10px;
        margin-right: -10px;
        width: 100%;
    }

    [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
        width: 100%;
    }

    /* Hero section improvements */
    .hero-title {
        font-size: 1.8rem;
        text-align: center;
        margin: 10vh auto 0;
        max-width: 90%;
    }

    .hero-text {
        text-align: center;
        margin: 3vh auto 0;
        padding: 0 15px;
    }

    .hero-subtitle,
    .hero-description {
        text-align: center;
        font-size: 1rem;
    }

    #heroVideo {
        /* Ensure the video covers the screen and is centered */
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* About section improvements */
@media screen and (max-width: 767px) {
    .about-section {
        text-align: center;
        padding: 40px 0;
    }

    .about-content {
        text-align: center;
        margin: 0 auto;
    }

    .about-text {
        text-align: center;
        margin: 0 auto;
        max-width: 90%;
    }

    .stats-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
        transform: translateX(15px);
        justify-items: center;
    }

    .stat-item {
        max-width: 280px;
        display: flex;
        flex-direction: column;
        align-items: center; /* This will center the number */
        text-align: center; /* Center the text as well */
    }

    .stats-number {
        font-size: 2.5rem;
        margin-bottom: 10px;
        margin-right: 30px;
        /* No width, so it shrinks to content and can be centered */
    }

    .stats-text {
        font-size: 0.9rem;
        width: 100%; /* Take the full width of the parent */
        text-align: center; /* Align text to the left inside this element */
        margin: 0;
    }

    /* Section titles global */
    .section-title,
    h1, h2, h3, h4, h5, h6 {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        max-width: 90%;
    }

    /* Programs section improvements */
    .programs .section-title {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .programs .nav {
        flex-direction: column;
        width: 100%;
        margin-bottom: 20px;
    }

    .programs .nav-item {
        width: 100%;
        margin: 5px 0;
    }

    .programs .nav-link {
        width: 100%;
        text-align: center;
        padding: 12px;
        border-radius: 8px;
    }

    .program-card {
        margin: 15px 0;
        padding: 25px;
        min-height: 220px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-bottom: 20px;
        overflow: visible;
        width: 100%;
    }

    /* Partners section improvements */
    .partners {
        text-align: center;
        padding: 40px 0;
    }

    .partners .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .partners .section-description {
        text-align: center;
        width: 100%;
        margin: 0 auto 30px;
        padding: 0 15px;
    }

    .partners-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .partners-grid > a:nth-child(1) { order: 1; } /* SKOLKOVO */
    .partners-grid > a:nth-child(4) { order: 2; } /* БЕЛ ВЭБ */
    .partners-grid > a:nth-child(2) { order: 3; } /* vebtech */
    .partners-grid > a:nth-child(3) { order: 4; } /* WHITEBIRD */
    .partners-grid > a:nth-child(5) { order: 5; } /* СМАРТ МУЛЬТИ СЕРВИС */
    .partners-grid > a:nth-child(6) { order: 6; } /* MYFIN */

    .partner-logo {
        max-width: 180px;
        max-height: 70px;
        margin: 0 auto;
    }

    .partner-card {
        min-height: 120px;
        padding: 20px;
    }

    /* Future programs improvements */
    .future-programs {
        padding: 40px 0;
    }

    .future-program-card {
        margin: 15px auto;
        padding: 20px;
        display: flex;
        flex-direction: column;
        max-width: 90%;
        text-align: center;
    }

    .program-date {
        font-size: 0.9rem;
        margin-top: 15px;
        order: 2;
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
    }

    .program-title {
        order: 1;
        margin-bottom: 10px;
        font-size: 1.2rem;
        text-align: center;
    }

    .program-status {
        text-align: center;
        width: 100%;
        margin: 10px 0;
        font-size: 0.9rem;
    }

    .program-link {
        text-align: center;
        width: 100%;
        margin: 5px 0;
    }

    /* Credit card section improvements */
    .belveb-promo-card {
        margin: 20px auto;
        padding: 30px 20px;
        box-sizing: border-box;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .belveb-promo-card .promo-card-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .belveb-promo-card .promo-card-info {
        order: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .belveb-promo-card h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .belveb-promo-card .promo-card-percent {
        margin-bottom: 1rem;
    }

    .belveb-promo-card .percent-subtext,
    .belveb-promo-card .promo-card-terms {
        font-size: 0.9rem !important;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    .belveb-promo-card .promo-card-info a.back-to-main {
        margin-top: 1rem;
        display: inline-block;
    }

    .belveb-promo-card .promo-card-logo {
        order: 2;
        margin-top: 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .belveb-promo-card .promo-card-logo img {
        max-width: 220px;
        margin-bottom: 1rem;
    }

    .belveb-promo-card .promo-card-link {
        order: 3;
        margin-top: 1.5rem;
    }

    .belveb-promo-card .btn {
        font-size: 1rem;
        padding: 12px 20px;
        width: auto;
        display: inline-block;
    }

    .credit-card-content {
        position: relative;
        width: 100%;
    }

    .credit-card-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
        text-align: center;
    }

    .credit-card-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
        text-align: center;
    }

    .credit-card .btn {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    /* General text alignments */
    .section-description,
    .text-content {
        text-align: center;
        font-size: 0.9rem;
    }

    /* Mobile menu fixes */
    .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #00062B;
        padding: 80px 20px 20px;
        z-index: 999;
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        overflow-y: auto;
        height: 100vh;
        width: 100vw;
    }

    .navbar-collapse.show {
        display: flex;
        background-color: #00062B;
        transform: none;
    }

    .nav-item {
        margin: 10px 0;
        text-align: center;
        opacity: 1 !important;
        width: 100%;
    }

    .nav-link {
        font-size: 18px;
        padding: 10px 0 !important;
        opacity: 1 !important;
        color: #fff !important;
        width: 100%;
        display: block;
    }

    .main-header .social-links {
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: center;
        gap: 25px;
        opacity: 1 !important;
        width: 100%;
    }

    .navbar-toggler {
        z-index: 1000;
        position: relative;
    }

    /* Ensure menu items are visible */
    .navbar-collapse.show .nav-item,
    .navbar-collapse.show .nav-link,
    .navbar-collapse.show .social-links {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1199px) {
    /* Custom Tablet Header Menu */
    .navbar-toggler {
        display: none;
    }
    .navbar-collapse {
        display: flex !important;
        justify-content: flex-end;
        align-items: center;
        width: auto;
        background-color: transparent;
        position: static;
        height: auto;
        transform: none !important;
        padding: 0;
    }
    .navbar-nav {
        flex-direction: row;
        align-items: center;
        margin-bottom: 0 !important;
        padding: 0;
        flex-basis: auto;
        margin-right: 1.5rem;
    }
    .main-header .social-links {
        margin-left: 0;
    }
    .nav-item {
        margin: 0 0.3rem;
    }
    .nav-link {
        font-size: 0.9rem !important;
        padding: 0.5rem !important;
    }
    .main-header .social-links {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
        padding-top: 0;
        border-top: none;
        margin-top: 0;
        margin-left: 2rem;
    }

    /* Partners Grid */
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .partners-grid > a {
        order: initial !important; /* Reset order for tablets */
    }

    /* Belveb Promo Card */
    .belveb-promo-card {
        padding: 40px;
        margin-top: 60px;
    }
    .belveb-promo-card .promo-card-content {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: center;
        text-align: left;
    }
    .belveb-promo-card .promo-card-info h2 {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }
    .belveb-promo-card .percent-number {
        font-size: 3rem;
    }
    .belveb-promo-card .promo-card-logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: 0;
    }
    .belveb-promo-card .promo-card-logo img {
        max-width: 180px;
    }

    /* About Us Section Fix */
    .about-us .section-title {
        margin-bottom: 3rem !important;
    }

    /* Partners Header Fix */
    .partners .section-title {
        font-size: 2.5rem !important;
    }
    .partners-description {
        max-width: 480px;
        text-align: left;
    }

    /* Footer Layout Fix */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* Additional adjustments for height */
@media screen and (max-height: 800px) {
    .navbar-collapse {
        padding-top: 60px;
    }

    .nav-item {
        margin: 5px 0;
    }

    .main-header .social-links {
        padding-top: 15px;
    }
} 
/* Team Section Mobile */
@media screen and (max-width: 767px) {
    .team-member-content {
        height: 360px;
    }
    .team-grid {
        padding: 0 20px;
    }
}

/* Testimonials Section Mobile - REWRITTEN FOR CORRECT SCROLLING */
@media screen and (max-width: 767px) {
    .testimonials {
        padding: 40px 0;
        min-height: auto;
    }

    .testimonial-content {
        gap: 30px;
    }

    .testimonial-info {
        position: relative;
    }

    .testimonial-slide {
        display: none;
        position: relative;
        height: 450px;
    }

    .testimonial-slide.active {
        display: block;
        animation: fadeIn 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .testimonial-text {
        position: relative;
        height: 100%;
        padding-bottom: 120px;
        box-sizing: border-box;
    }

    .testimonial-text blockquote {
        padding-right: 10px;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .testimonial-text blockquote::-webkit-scrollbar {
        width: 5px;
    }

    .testimonial-text blockquote::-webkit-scrollbar-track {
        background: transparent;
    }

    .testimonial-text blockquote::-webkit-scrollbar-thumb {
        background-color: rgba(11, 11, 59, 0.2);
        border-radius: 3px;
    }

    .testimonial-author {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: #FFFFFF;
        height: 120px;
        box-sizing: border-box;
    }

    .navigation-arrows {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 20px;
    }

    .testimonials .nav-arrow {
        width: 45px;
        height: 45px;
        background-color: rgba(11, 11, 59, 0.05);
        color: var(--primary-color);
        transition: background-color 0.3s ease;
    }

    .testimonials .nav-arrow:hover {
        background-color: rgba(11, 11, 59, 0.1);
    }
} 

/* Legal Documents (policy.php, rules.php) Mobile Styles */
@media screen and (max-width: 767px) {
    .legal-document {
        padding: 20px 0;
    }

    .document-header {
        margin-bottom: 30px;
        text-align: center;
    }

    .document-header h1 {
        font-size: 1.6rem;
        margin-top: 15px;
        margin-bottom: 10px;
    }

    .document-header p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .document-content h3 {
        font-size: 1.3rem;
        margin-top: 30px;
        margin-bottom: 15px;
    }

    .document-content p,
    .document-content li {
        font-size: 1rem;
        line-height: 1.6;
        text-align: justify;
    }

    .document-content ul {
        padding-left: 20px;
        margin-bottom: 15px;
    }
    
    .document-content ul li {
        margin-bottom: 10px;
    }

    /* Rules page table */
    .table-bordered {
        width: 100% !important; /* Force table to full width */
        font-size: 0.9rem;
    }

    .table-bordered th,
    .table-bordered td {
        padding: 8px;
    }
} 
