/* responsive.css - Mobile Responsiveness Improvements */

/* Add viewport-responsive base font size */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* Improved mobile container */
@media (max-width: 768px) {
    .container {
        width: 92%;
        padding: 20px 10px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 94%;
        padding: 15px 8px;
    }
}

/* Mobile header and navigation fixes */
@media (max-width: 768px) {
    header {
        padding: 12px 0;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999;
    }
    
    .menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        right: 20px;
        z-index: 1001;
        cursor: pointer;
        width: 30px;
        height: 25px;
    }
    
    .menu-toggle span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: #64ffda;
        border-radius: 3px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: .25s ease-in-out;
    }
    
    .menu-toggle span:nth-child(1) {
        top: 0px;
    }
    
    .menu-toggle span:nth-child(2), .menu-toggle span:nth-child(3) {
        top: 10px;
    }
    
    .menu-toggle span:nth-child(4) {
        top: 20px;
    }
    
    .menu-toggle.active span:nth-child(1) {
        top: 10px;
        width: 0%;
        left: 50%;
    }
    
    .menu-toggle.active span:nth-child(2) {
        transform: rotate(45deg);
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg);
    }
    
    .menu-toggle.active span:nth-child(4) {
        top: 10px;
        width: 0%;
        left: 50%;
    }
    
    nav ul {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: rgba(10, 25, 47, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-left: 1px solid rgba(100, 255, 218, 0.1);
        padding: 80px 20px 30px;
        transition: right 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }
    
    nav ul.active {
        right: 0;
    }
    
    nav ul li {
        margin: 12px 0;
        width: 100%;
    }
    
    nav ul li a {
        display: block;
        padding: 8px 0;
        font-size: 1.1rem;
    }
    
    .language-switch, .theme-switch {
        margin-top: 20px;
    }
    
    .language-switch a, .theme-switch button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }
}

/* Improved responsive grid layouts */
@media (max-width: 992px) {
    .skills-grid, .projects-grid, .blog-grid {
        gap: 20px;
    }
    
    .projects-grid, .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Make blog and projects appear in 2 columns on mobile */
    .projects-grid, .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Make cards smaller on mobile */
    .blog-card, .project-card {
        transform: scale(0.95);
    }
    
    .blog-img, .project-img {
        height: 160px !important;
    }
    
    .blog-info, .project-info {
        padding: 15px;
    }
    
    .blog-info h3, .project-info h3 {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
    }
    
    .blog-info p, .project-info p {
        font-size: 0.9rem !important;
        margin-bottom: 10px !important;
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Make sure project technology tags are always displayed horizontally */
    .project-tech {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    .project-tech span {
        padding: 3px 8px !important;
        font-size: 10px !important;
        display: inline-block !important;
    }
    
    .blog-link {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .blog-grid, .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .blog-card, .project-card {
        transform: scale(0.9);
    }
    
    .blog-img, .project-img {
        height: 140px;
    }
    
    .project-info, .blog-info {
        padding: 12px;
    }
}

/* Improve responsive skill cards for mobile */
@media (max-width: 768px) {
    .skill-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 15px;
        border-radius: 10px;
    }
    
    .skill-card i {
        font-size: 2.5rem;
        margin-bottom: 0;
        margin-right: 20px;
        flex-shrink: 0;
    }
    
    .skill-card h3 {
        margin-bottom: 5px;
        font-size: 1.2rem;
        min-width: 80px;
        margin-right: 15px;
    }
    
    .skill-circle-svg {
        width: 80px;
        height: 80px;
        margin: 0;
        margin-left: auto;
    }
    
    .circle-inner {
        font-size: 16px;
    }
}

/* Improve project filter section for mobile */
@media (max-width: 768px) {
    .project-filter {
        margin-bottom: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-btn {
        padding: 6px 12px;
        margin: 0 3px 8px;
        font-size: 0.85rem;
    }
}

/* Fix form inputs on smaller screens */
@media (max-width: 768px) {
    .form-group input, 
    .form-group select, 
    .form-group textarea {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .login-btn, 
    .submit-btn, 
    .cancel-btn {
        padding: 10px 15px;
        font-size: 0.95rem;
    }
}

/* Fix contact section on mobile */
@media (max-width: 768px) {
    .contact-content {
        flex-direction: column;
    }
    
    .contact-info, .contact-form {
        width: 100%;
    }
    
    .contact-info {
        margin-bottom: 30px;
    }
}

/* Fix hero section on mobile */
@media (max-width: 768px) {
    .hero {
        min-height: 90vh;
        padding-top: 80px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.3rem;
    }
    
    .hero .subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hero-buttons .btn {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }
}

/* Fix about section on mobile */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column-reverse;
    }
    
    .about-text, .about-media {
        width: 100%;
    }
    
    .about-media {
        margin-bottom: 25px;
        display: flex;
        justify-content: center;
    }
    
    .profile-image {
        width: 180px;
        height: 180px;
    }
}

/* Fix testimonials on mobile */
@media (max-width: 768px) {
    .testimonial-slide {
        padding: 15px;
    }
    
    .testimonial-text {
        font-size: 0.95rem;
        padding: 15px;
    }
    
    .testimonial-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .author-info {
        margin: 10px 0;
    }
    
    .testimonial-controls {
        margin-top: 15px;
    }
}

/* Fix modals and floating elements on mobile */
@media (max-width: 768px) {
    .chatbot-modal.active, 
    .support-form.active,
    .login-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    
    .chatbot-container, 
    .support-container,
    .login-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chatbot-messages {
        max-height: calc(100vh - 130px);
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
    }
    
    .chatbot-toggle-btn {
        right: 20px;
    }
    
    .support-button {
        left: 20px;
    }
}

/* Fix auth buttons on mobile */
@media (max-width: 768px) {
    .auth-buttons {
        top: 15px;
        left: 15px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* Fix buttons on mobile */
@media (max-width: 480px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .login-btn, .submit-btn, .cancel-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Fix section spacing on mobile */
@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
    
    section h2 {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }
    
    section h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
}

/* Fix testimonial form on mobile */
@media (max-width: 768px) {
    .testimonial-form-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        padding: 20px;
        overflow-y: auto;
    }
    
    .close-testimonial-form {
        top: 15px;
        right: 15px;
    }
}

/* Fix footer on mobile */
@media (max-width: 768px) {
    footer {
        padding: 20px 0;
    }
    
    footer p {
        font-size: 0.85rem;
    }
}

/* Mobile-first improvements for spacing */
@media (max-width: 768px) {
    .content-wrapper {
        padding-top: 0;
    }
    
    #mainContent {
        padding-top: 60px;
    }
    
    .auth-buttons {
        z-index: 998;
    }
}

/* Additional fixes for extremely small screens */
@media (max-width: 380px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .skill-card i {
        font-size: 2rem;
    }
    
    .skill-circle-svg {
        width: 65px;
        height: 65px;
    }
    
    .circle-inner {
        font-size: 14px;
    }
}

/* Fix meta tag for proper mobile view */
@media (max-width: 768px) {
    .meta-viewport {
        width: device-width;
        initial-scale: 1.0;
        maximum-scale: 1.0;
        user-scalable: no;
    }
}

/* Prevent scrolling when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Improved touch interactions for mobile */
@media (max-width: 768px) {
    /* Make links and buttons more tappable */
    a, button, .filter-btn, .chat-option-btn, .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 15px;
        margin: 5px 0;
    }
    
    /* Better tap targets for navigation */
    nav ul li a {
        padding: 12px 0;
        display: block;
    }
    
    /* Fix for iOS overscroll behavior */
    .chatbot-messages, 
    .testimonial-form-container,
    .support-container,
    nav ul {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix for chat options container */
    .chat-option-buttons {
        flex-wrap: wrap;
    }
    
    /* Improved mobile touch form inputs */
    input, 
    select, 
    textarea, 
    button {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Fix overlapping skill cards on mobile */
@media (max-width: 768px) {
    .skill-card {
        margin-bottom: 15px !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15) !important;
    }
    
    /* Improve spacing for sections on mobile */
    section {
        margin: 15px 0 !important;
    }
    
    /* Improved header positioning on mobile */
    header {
        position: fixed !important;
        top: 0 !important;
        width: 100% !important;
        z-index: 999 !important;
    }
    
    /* Add padding to container elements on mobile */
    .contact-content, 
    .blog-grid, 
    .projects-grid,
    .testimonials-slider {
        padding: 5px !important;
    }
    
    /* Fix mobile spacing for project cards */
    .project-card, .blog-card {
        margin-bottom: 25px !important;
    }
}

/* Enhanced mobile menu styles */
@media (max-width: 768px) {
    #mobileMenu {
        padding-top: 70px !important;
    }
    
    #mobileMenu li {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    #mobileMenu.active li {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Staggered animation for menu items */
    #mobileMenu.active li:nth-child(1) { transition-delay: 0.1s; }
    #mobileMenu.active li:nth-child(2) { transition-delay: 0.15s; }
    #mobileMenu.active li:nth-child(3) { transition-delay: 0.2s; }
    #mobileMenu.active li:nth-child(4) { transition-delay: 0.25s; }
    #mobileMenu.active li:nth-child(5) { transition-delay: 0.3s; }
    #mobileMenu.active li:nth-child(6) { transition-delay: 0.35s; }
    #mobileMenu.active li:nth-child(7) { transition-delay: 0.4s; }
    #mobileMenu.active li:nth-child(8) { transition-delay: 0.45s; }
    #mobileMenu.active li:nth-child(9) { transition-delay: 0.5s; }
}

/* Fixed positioning for modal elements */
@media (max-width: 768px) {
    .chatbot-modal.active, 
    .support-form.active,
    .login-modal,
    .testimonial-form-container.active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        overflow-y: auto !important;
    }
}

/* Hide background animation on mobile */
@media (max-width: 768px) {
    #backgroundCanvas {
        display: none !important;
    }
    
    body {
        background-color: #07132a !important;
    }
} 