/* Mobile-First Responsive Styles for Services and Projects */

/* Navbar Mobile Enhancements */
@media screen and (max-width: 992px) {
    header {
        height: 80px !important;
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    header .navbar {
        width: 90%;
        padding: 10px 5px;
        position: relative;
    }
    
    header .logo {
        width: 120px;
    }
    
    .toggle-btn {
        background: transparent;
        border: none;
        color: white;
        font-size: 1.8rem;
        cursor: pointer;
        padding: 8px;
        transition: transform 0.3s ease;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1000;
        display: block !important;
    }
    
    .toggle-btn:hover {
        transform: translateY(-50%) scale(1.1);
    }
    
    /* Fix for logo and toggle button positioning */
    header .logo {
        width: 120px;
        position: relative;
        z-index: 1000;
    }
    
    /* Hide desktop links on mobile */
    header .navbar .links {
        display: none !important;
    }
    
    /* User menu for mobile */
    .responsive-links .user-section {
        width: 100%;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: white;
        font-weight: bold;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        background-color: rgba(0, 0, 0, 0.3);
        transition: background-color 0.3s ease;
    }
    
    .responsive-links .user-section:hover {
        background-color: rgba(0, 0, 0, 0.5);
    }
    
    .responsive-links .user-section span {
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    .responsive-links .user-section i {
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    .responsive-links .user-menu.show + .user-section i {
        transform: rotate(180deg);
    }
    
    .responsive-links .user-menu {
        background-color: rgba(40, 40, 40, 0.9);
        padding: 0;
        display: none;
        border-radius: 0 0 5px 5px;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .responsive-links .user-menu.show {
        display: block;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .responsive-links .user-menu a {
        padding: 12px 15px 12px 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        color: white;
        text-decoration: none;
        display: block;
        font-size: 14px;
        transition: background-color 0.3s ease;
    }
    
    .responsive-links .user-menu a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .responsive-links .user-menu a:last-child {
        border-bottom: none;
        font-weight: bold;
        color: #ff6b6b;
    }
    
    .responsive-links .user-menu a.logout-btn {
        background-color: rgba(255, 59, 59, 0.2);
    }
    
    .responsive-links {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.9);
        z-index: 999;
        padding: 10px 0;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        display: none;
    }
    
    .responsive-links.active {
        display: block;
    }
    
    .responsive-links .links {
        display: flex;
        flex-direction: column;
        padding: 0 20px;
    }
    
    .responsive-links a.nav-btn {
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 16px;
        display: block;
        width: 100%;
        text-align: left;
    }
    
    .responsive-links .dropdown {
        width: 100%;
    }
    
    .responsive-links .btn-btn {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .responsive-links .btn-btn button {
        background: transparent;
        border: none;
        color: white;
        padding: 12px;
        cursor: pointer;
    }
    
    .responsive-links .dropdown-content {
        background-color: rgba(0, 0, 0, 0.8);
        padding: 0;
        display: none;
    }
    
    .responsive-links #service-dropdown.dropdown-content {
        display: none;
    }
    
    .responsive-links #service-dropdown.dropdown-content[style*="display: block"] {
        display: block !important;
    }
    
    .responsive-links .dropdown-subMenu button {
        width: 100%;
        text-align: left;
        padding: 12px 15px;
        background-color: rgba(50, 50, 50, 0.5);
        border: none;
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .responsive-links .submenu-content {
        background-color: rgba(70, 70, 70, 0.5);
        padding-left: 15px;
        display: none;
    }
    
    .responsive-links .submenu-content.show {
        display: block;
    }
    
    .responsive-links .submenu-content a {
        padding: 10px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* Base mobile styles */
.services .first-section,
.build .first-section {
    height: 200px;
    padding: 80px 15px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.services .first-section h1,
.build .first-section h1 {
    font-size: 1.8rem;
    margin: 0;
    padding: 0 10px;
    line-height: 1.3;
}

/* Services Section - Mobile */
@media screen and (max-width: 768px) {
    /* Fix for the first section (Our Services heading) */
    .services .first-section {
        height: auto !important;
        min-height: 200px !important;
        padding-top: 120px !important;
        padding-bottom: 20px !important;
    }
    
    .services .first-section h1 {
        font-size: 1.8rem !important;
        margin-bottom: 10px !important;
    }
    
    .services .first-section h4 {
        font-size: 1rem !important;
        text-align: center !important;
        padding: 0 15px !important;
    }
    .services .second-section {
        flex-direction: column;
        height: auto !important;
        min-height: auto !important;
    }
    
    .services .second-section .text-block,
    .services .second-section .img-block {
        width: 100% !important;
        height: auto !important;
        padding: 20px !important;
    }
    
    .services .second-section .text-block img {
        width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
        object-fit: cover !important;
    }
    
    .services .second-section .text-block h1 {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }
    
    .services .second-section .text-block p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
    
    /* Fix for the third section card layout */
    .services .third-section {
        padding: 15px !important;
    }
    
    .services .third-section .card-block {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .services .third-section .card-block .card {
        width: 100% !important;
        height: auto !important;
        min-height: 400px !important;
        margin-bottom: 20px !important;
    }
    
    .services .third-section .card-block .card .img-block {
        height: 200px !important;
    }
    
    .services .third-section .card-block .card .text-block {
        padding: 15px !important;
    }
}

.services .second-section .text-block,
.services .second-section .img-block {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.services .second-section .img-block {
    order: -1;
}

.services .third-section .card-block {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
}

.services .third-section .card {
    width: 100%;
    min-height: 380px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.services .third-section .img-block {
    height: 180px;
}

.services .third-section .text-block {
    padding: 15px;
}

/* Projects Section - Mobile */
.projects .second-section {
    padding: 15px 10px;
}

.projects .second-section nav {
    flex-direction: column;
    gap: 10px;
    padding: 0 5px 15px;
}

.projects .second-section nav button {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border-radius: 6px;
}

.projects .card-block {
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Modal Adjustments */
.modal-container {
    width: 95% !important;
    max-width: 100% !important;
    flex-direction: column;
    padding: 10px;
}

.modal .img-block {
    display: none;
}

.modal-content {
    padding: 20px 15px !important;
}

.login-form label {
    font-size: 14px !important;
    margin-bottom: 5px !important;
}

.login-form input {
    padding: 10px !important;
    font-size: 14px !important;
    margin-bottom: 12px !important;
}

.login-btn {
    padding: 10px 20px !important;
    font-size: 15px !important;
    width: 100%;
    margin-top: 10px !important;
}

@media (min-width: 600px) {
    .services .third-section .card-block {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects .second-section nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .projects .second-section nav button {
        width: calc(50% - 5px);
    }
}

@media screen and (max-width: 768px) {
    .home .testimonials .next-prev {
        width: 100%;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        margin: 20px 0;
    }
    
    .home .testimonials .next-prev .prev,
    .home .testimonials .next-prev .next {
        position: relative;
        width: 36px;
        height: 36px;
        margin: 0 15px;
        font-size: 14px;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: all 0.3s ease;
        background-color: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
    
    .home .testimonials .next-prev .prev {
        right: auto;
    }
    
    .home .testimonials .next-prev .next {
        left: auto;
    }
    
    .home .testimonials .next-prev .prev:hover,
    .home .testimonials .next-prev .next:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }
    
    .home .testimonials .next-prev .prev:active,
    .home .testimonials .next-prev .next:active {
        transform: scale(0.9);
        background-color: rgba(255, 255, 255, 0.4);
    }
    
    /* Improve the testimonial card display on mobile */
    .home .testimonials .testimonial-card {
        width: 280px;
        height: auto;
        min-height: 180px;
        padding: 20px;
        margin: 0 auto;
    }
    
    .home .testimonials .write-review {
        margin-top: 15px;
        padding: 8px 15px;
        font-size: 14px;
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.6);
        border-radius: 20px;
        transition: all 0.3s ease;
    }
    
    .home .testimonials .write-review:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
    
    .home .testimonials .write-review:active {
        transform: scale(0.95);
    }
}

/* Desktop Styles */
@media (min-width: 992px) {
    .services .second-section {
        flex-direction: row;
    }
    
    .services .second-section .text-block,
    .services .second-section .img-block {
        width: 50%;
    }
    
    .services .second-section .img-block {
        order: 1;
    }
    
    .services .third-section .card-block {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .projects .card-block {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-container {
        max-width: 800px !important;
        flex-direction: row;
    }
    
    .modal .img-block {
        display: block;
        width: 40%;
    }
    
    .modal-content {
        width: 60%;
    }
}
