/* WhatsApp Icon Responsive Styles */
@media (max-width: 768px) {
    .whatsapp-icon {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
    }

    .whatsapp-icon i {
        font-size: 24px;
    }

    .whatsapp-tooltip {
        font-size: 10px;
        padding: 6px 10px;
        right: 55px;
    }
}

/* Mobile Navigation - Modern UI with animations */
@media (max-width: 768px) {
    .navbar {
        padding: 0.7rem 0;
    }

    .logo a {
        transform: scale(0.9);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 60px;
        /* Reduced from 70px to match smaller navbar */
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        text-align: center;
        transition: all 0.4s ease-in-out;
        box-shadow: 0 10px 20px rgba(255, 59, 48, 0.15);
        z-index: 10;
        height: calc(100vh - 60px);
        /* Adjusted to match top position */
        overflow-y: auto;
        border-top: 2px solid var(--primary-light);
    }

    .nav-links.active {
        left: 0;
        animation: slideInMenu 0.4s ease-in-out forwards;
    }

    @keyframes slideInMenu {
        from {
            left: -100%;
        }

        to {
            left: 0;
        }
    }

    .nav-links ul {
        display: flex;
        flex-direction: column;
        padding: 2rem 0;
        gap: 0;
    }

    .nav-links li {
        margin: 0;
        opacity: 0;
        transform: translateY(20px);
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
        transition: all 0.4s ease;
    }

    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.4s;
    }

    .nav-links a {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 59, 48, 0.1);
        width: 90%;
        margin: 0 auto;
        gap: 12px;
        font-weight: 500;
    }

    .nav-links a i {
        font-size: 1rem;
        color: var(--primary-color);
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 59, 48, 0.1);
        border-radius: 50%;
        padding: 8px;
    }

    .nav-links a:hover i {
        transform: scale(1.2);
        background-color: rgba(255, 59, 48, 0.2);
    }

    .nav-links a:hover {
        color: var(--primary-color);
    }

    .nav-links a::after {
        display: none;
    }

    .hamburger {
        display: block;
        z-index: 20;
        background-color: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        border-radius: 5px;
        transition: all 0.3s ease;
    }

    .hamburger:hover {
        background-color: rgba(255, 59, 48, 0.1);
    }

    .hamburger .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: #000000;
        transition: all 0.3s ease;
        border-radius: 3px;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: var(--primary-color);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: var(--primary-color);
    }
}

/* Tablet Styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .hero-image {
        max-width: 450px;
        margin: 0 auto;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }

    .tool-card {
        padding: 1.5rem;
    }

    .about-content,
    .contact-content {
        gap: 3rem;
    }

    .footer-content {
        gap: 3rem;
    }

    /* Tool pages on tablet */
    .tool-container {
        padding: 1.5rem;
    }

    .filters-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .preset-filters {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    /* Make buttons easier to tap */
    .btn {
        padding: 0.8rem 1.6rem;
    }

    .action-btn {
        min-width: 120px;
    }
}

/* Responsive Layout */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content,
    .hero-image {
        width: 100%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-image {
        margin-top: 2rem;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form-card,
    .contact-info-card {
        padding: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .social-links-grid {
        grid-template-columns: 1fr;
    }

    .tool-interface {
        flex-direction: column;
    }

    /* Adjust sections spacing */
    .hero,
    .tools-section,
    .about-section,
    .contact-section {
        padding: 3rem 0;
    }

    .section-title {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .tool-card {
        padding: 1.5rem;
    }

    .tool-container {
        padding: 1.5rem;
    }

    .buttons-group {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        margin-bottom: 0.8rem;
    }

    /* Improve tool pages on mobile */
    .tool-header h1 {
        font-size: 1.8rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-area i {
        font-size: 2.5rem;
    }

    .control-group label {
        font-size: 0.9rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Make form elements more touch-friendly */
    input[type="range"] {
        height: 30px;
    }

    input[type="color"] {
        height: 44px;
        width: 44px;
    }

    /* Reduce padding for all content */
    .container {
        padding: 0 15px;
    }

    /* Enhance touch targets */
    .category-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    /* Fix tool information section */
    .tool-info {
        padding: 2rem 15px;
    }

    .info-step {
        flex-direction: column;
        text-align: center;
        margin-bottom: 2rem;
    }

    .step-number {
        margin: 0 auto 1rem;
    }

    /* Adjust preset filters for better mobile view */
    .preset-filters {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.8rem;
    }

    .preset-filter p {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .categories {
        overflow-x: auto;
        padding-bottom: 1rem;
        justify-content: flex-start;
        flex-wrap: nowrap;
        margin-bottom: 2rem;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }

    .category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .contact-form {
        width: 100%;
    }

    .form-group input,
    .form-group textarea {
        font-size: 0.9rem;
        padding: 0.9rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-links-section {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .modal-content {
        padding: 1rem;
        width: 95%;
    }

    .tool-header h1 {
        font-size: 1.5rem;
    }

    /* Enhance mobile navigation */
    .logo {
        font-size: 1.3rem;
    }

    /* Make buttons more touch-friendly */
    .btn {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .primary-btn {
        width: 100%;
        display: block;
        text-align: center;
    }

    /* Preset filters for very small screens */
    .preset-filters {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Tool specific responsive fixes */
    .color-swatches {
        gap: 0.8rem;
    }

    .color-swatch {
        width: 36px;
        height: 36px;
    }

    .brush-size {
        width: 26px;
        height: 26px;
    }

    /* Fix spacing issues */
    .about-features {
        margin-top: -1rem;
    }

    .feature {
        margin-bottom: 1.5rem;
    }

    /* About Section Responsive */
    .about-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-text {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-stats {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .about-features-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .feature-item {
        padding: 1.5rem;
    }

    .feature-item .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Improve canvas display */
    .preview-area canvas {
        max-width: 100%;
        height: auto !important;
    }
}

/* Very small devices */
@media (max-width: 375px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .tool-icon {
        font-size: 1.7rem;
    }

    .tool-card h3 {
        font-size: 1.1rem;
    }

    .preset-filters {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Ensure tool controls are usable */
    .control-group label {
        font-size: 0.85rem;
    }

    /* Reduce unnecessary spacing */
    .section-title {
        font-size: 1.7rem;
    }

    .tool-features ul li {
        font-size: 0.9rem;
        margin-bottom: 0.7rem;
    }

    /* About Section for very small screens */
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .about-features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-item {
        padding: 1.2rem;
    }

    .feature-item .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .about-card {
        padding: 1.5rem;
    }

    .about-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .footer,
    .hero,
    .about-section,
    .contact-section,
    .tools-section {
        display: none;
    }

    .tool-page {
        padding: 0;
    }

    .tool-container {
        box-shadow: none;
        padding: 0;
    }

    .buttons-group {
        display: none;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .hero p {
        margin-bottom: 1.5rem;
    }

    .nav-links {
        height: calc(100vh - 60px);
    }

    .nav-links ul {
        padding: 1rem 0;
    }

    .nav-links li {
        margin: 0.8rem 0;
    }

    /* Improve landscape tool usage */
    .tool-interface {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    #filters-preview,
    #compress-preview,
    .preview-area {
        flex: 1;
        min-width: 300px;
    }

    #filters-controls,
    #compress-controls,
    .tool-controls {
        flex: 1;
        min-width: 300px;
    }
}