/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
    padding-bottom: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header - Responsive */
.main-header {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    color: #2d3748;
    margin-bottom: 5px;
}

.logo i {
    color: #4f46e5;
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-links a:hover {
    color: #4f46e5;
    background: #f7fafc;
}

/* Mobile Menu Toggle (Hidden by default, shows on small screens) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4f46e5;
    cursor: pointer;
}

/* Hero Section - Responsive */
.hero {
    text-align: center;
    padding: 40px 15px 25px;
}

.hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    color: #1a202c;
    margin-bottom: 15px;
    line-height: 1.3;
}

.hero h1 i {
    color: #4f46e5;
    margin-right: 12px;
}

.tagline {
    font-size: 1.1rem;
    color: #4a5568;
    max-width: 700px;
    margin: 0 auto 25px;
    line-height: 1.5;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.stat {
    background: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
    flex: 1;
    max-width: 200px;
}

.stat i {
    color: #4f46e5;
    font-size: 1.3rem;
}

.stat strong {
    color: #2d3748;
}

/* Upload Section - Responsive */
.upload-section {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
    margin: 25px 0;
}

.controls-card, .upload-card {
    background: white;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.controls-card h2, .upload-card h2 {
    font-family: 'Poppins', sans-serif;
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s;
}

.input-group input[type="number"]:focus {
    border-color: #4f46e5;
    outline: none;
}

/* Toggle Switch */
.toggle-switch {
    margin-top: 10px;
}

.toggle-switch input {
    display: none;
}

.toggle-label {
    display: block;
    width: 55px;
    height: 28px;
    background: #cbd5e0;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-label:after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

input:checked + .toggle-label {
    background: #4f46e5;
}

input:checked + .toggle-label:after {
    transform: translateX(27px);
}

.note {
    margin-top: 18px;
    padding: 10px;
    background: #edf2f7;
    border-radius: 8px;
    color: #4a5568;
    font-size: 0.9rem;
}

.note i {
    color: #4f46e5;
    margin-right: 6px;
}

/* Upload Area - Responsive */
.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 14px;
    padding: 50px 20px;
    text-align: center;
    transition: border 0.3s;
    position: relative;
    margin-bottom: 20px;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #4f46e5;
    background: #f7fafc;
}

.upload-icon {
    font-size: 3.5rem;
    color: #a0aec0;
    margin-bottom: 15px;
}

.upload-area p {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #4a5568;
}

.formats {
    font-size: 0.9rem !important;
    color: #718096 !important;
    margin-bottom: 25px !important;
}

#fileInput {
    display: none;
}

.upload-btn {
    display: inline-block;
    background: #4f46e5;
    color: white;
    padding: 14px 35px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
}

.upload-btn:hover {
    background: #4338ca;
}

/* Buttons - Responsive */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    flex: 1;
    min-width: 160px;
}

.primary-btn {
    background: linear-gradient(to right, #4f46e5, #7c3aed);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(79, 70, 229, 0.3);
}

.success-btn {
    background: linear-gradient(to right, #10b981, #34d399);
    color: white;
}

.success-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(16, 185, 129, 0.3);
}

.secondary-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.secondary-btn:hover {
    background: #cbd5e0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Preview Section - Responsive */
.preview-section {
    background: white;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin: 35px 0;
}

.preview-section h2 {
    font-family: 'Poppins', sans-serif;
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    min-height: 180px;
}

.image-item {
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s;
    position: relative;
}

.image-item:hover {
    transform: translateY(-5px);
}

.image-preview {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.image-info {
    padding: 12px;
}

.image-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    color: #2d3748;
    font-size: 0.95rem;
}

.image-size {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 10px;
}

/* Image Actions - FIXED FOR MOBILE */
.image-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap; /* Important: Prevents wrapping */
}

.action-btn {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.3s;
    min-width: 70px; /* Minimum width for mobile */
    white-space: nowrap; /* Prevents text breaking */
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-btn {
    background: #10b981;
    color: white;
}

.download-btn:hover {
    background: #0da271;
}

.remove-btn {
    background: #fed7d7;
    color: #c53030;
}

.remove-btn:hover {
    background: #feb2b2;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 15px;
    color: #a0aec0;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1rem;
}

/* Features - Responsive */
.features-section {
    margin: 50px 0;
}

.features-section h2 {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: #1a202c;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 25px;
}

.feature-card {
    background: white;
    padding: 30px 20px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
}

.feature-card i {
    font-size: 2.5rem;
    color: #4f46e5;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-family: 'Poppins', sans-serif;
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.feature-card p {
    color: #718096;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Footer - Responsive */
.main-footer {
    text-align: center;
    padding: 25px 15px;
    color: #4a5568;
    background: white;
    border-radius: 14px;
    margin-top: 35px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.main-footer p {
    margin-bottom: 10px;
}

.footer-links {
    margin-top: 12px;
}

.footer-links a {
    color: #4f46e5;
    text-decoration: none;
    margin: 0 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ========================= */
/* MEDIA QUERIES (Responsive) */
/* ========================= */

/* Tablet Devices (768px to 1024px) */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .upload-section {
        gap: 20px;
    }
    
    .stat {
        min-width: 130px;
        padding: 10px 15px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Tablets & Large Phones (600px to 768px) */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logo {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .upload-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .size-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn {
        min-width: 140px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .preview-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Mobile Phones (up to 600px) */
@media (max-width: 600px) {
    .container {
        padding: 0 10px;
    }
    
    .hero {
        padding: 30px 10px 20px;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .stats-bar {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .stat {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .controls-card, .upload-card {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-area p {
        font-size: 1rem;
    }
    
    .upload-btn {
        padding: 12px 30px;
        font-size: 0.95rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
    
    .preview-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .image-preview {
        height: 120px;
    }
    
    .image-name {
        font-size: 0.85rem;
    }
    
    .image-actions {
        flex-direction: row; /* Row mein rahega */
        gap: 6px;
    }
    
    .action-btn {
        padding: 8px;
        font-size: 0.8rem;
        min-width: 65px;
    }
    
    .action-btn i {
        margin-right: 3px;
    }
    
    /* Text chhota kar do mobile par */
    .action-btn span {
        display: none; /* Text hide kar do mobile par */
    }
    
    .action-btn i {
        margin-right: 0;
        font-size: 0.9rem;
    }
    
    .features-section h2 {
        font-size: 1.6rem;
    }
    
    .feature-card {
        padding: 25px 15px;
    }
    
    .main-footer {
        padding: 20px 10px;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-links a {
        margin: 0;
        padding: 5px 0;
    }
}

/* Very Small Phones (up to 400px) */
@media (max-width: 400px) {
    .logo {
        font-size: 1.4rem;
    }
    
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .tagline {
        font-size: 0.95rem;
    }
    
    .controls-card h2, .upload-card h2 {
        font-size: 1.2rem;
    }
    
    .preview-container {
        grid-template-columns: 1fr;
    }
    
    .image-preview {
        height: 150px;
    }
    
}

/* ========================= */
/* HAMBURGER MENU STYLES */
/* ========================= */

/* Hamburger Menu Button (Hidden on Desktop) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background: #4f46e5;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Hamburger Menu Animation - When Active */
.hamburger-menu.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    /* Show hamburger menu on mobile */
    .hamburger-menu {
        display: flex;
    }
    
    /* Hide nav links by default on mobile */
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        z-index: 999;
    }
    
    /* When menu is open */
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    /* Individual menu items */
    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 0;
        opacity: 0;
        transform: translateY(-20px);
        transition: all 0.3s ease;
    }
    
    /* Staggered animation for menu items */
    .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.active li:nth-child(5) { transition-delay: 0.5s; }
    
    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }
    
    .nav-links a {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
        border-bottom: 1px solid #f1f1f1;
        width: 100%;
        justify-content: center;
    }
    
    .nav-links a:hover {
        background: #f7fafc;
        color: #4f46e5;
    }
    
    .nav-links li:last-child a {
        border-bottom: none;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .nav-links {
        top: 65px;
    }
}

/* Overlay when menu is open */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.menu-overlay.active {
    display: block;
}