/* ============================================
   MOBILE-FIRST RESPONSIVE STYLES
   ============================================ */

/* Hamburger Menu */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background: currentColor;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    display: block;
    opacity: 1;
}

/* Mobile Menu Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #64748b;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.mobile-menu-link {
    display: block;
    padding: 1rem 1.5rem;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    background: #f1f5f9;
    border-left-color: #3B82F6;
    color: #3B82F6;
}

body.mobile-menu-open {
    overflow: hidden;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Base Mobile (up to 767px) */
@media (max-width: 767px) {
    /* Show hamburger, hide desktop nav */
    .hamburger-btn {
        display: flex;
    }
    
    .nav-links {
        display: none !important;
    }
    
    /* Navigation Bar */
    .navbar .container,
    .header-inner {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem !important;
    }
    
    /* Logo */
    .nav-brand,
    .logo {
        font-size: 1.1rem !important;
        display: flex !important;
        align-items: center;
        gap: 0.4rem;
    }
    
    .nav-brand img,
    .nav-brand span:first-child,
    .logo img,
    .logo span:first-child {
        font-size: 1.2rem !important;
    }
    
    /* Hide user info on mobile in header */
    .user-info {
        display: none;
    }
    
    /* Dashboard Welcome */
    .welcome-banner {
        padding: 1.5rem 1rem !important;
    }
    
    .welcome-inner {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .welcome-text h1 {
        font-size: 1.5rem !important;
    }
    
    .plan-badge-large {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    /* Container */
    .container {
        padding: 0 1rem !important;
    }
    
    /* Stats Grid - 2x2 */
    .stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-card .value {
        font-size: 2rem !important;
    }
    
    .stat-card .label {
        font-size: 0.8rem;
    }
    
    /* Main Grid - Stack */
    .main-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Forms */
    .quick-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .quick-form input,
    .quick-form button {
        width: 100%;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 44px;
    }
    
    /* Buttons - Full width & larger touch targets */
    .btn {
        min-height: 44px;
        width: 100%;
    }
    
    .btn-sm {
        min-height: 40px;
        width: auto;
        min-width: 100px;
    }
    
    /* Cards */
    .card {
        padding: 1.25rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    /* Pricing Grid - Stack */
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .pricing-card {
        margin: 0 !important;
    }
    
    /* Tables - Horizontal scroll */
    .comparison-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .comparison-table table {
        min-width: 600px;
    }
    
    /* Footer */
    footer > div > div:first-child {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 2rem;
    }
    
    footer ul {
        text-align: center;
    }
    
    footer > div > div:last-child {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    /* History & Sites Pages */
    .history-card,
    .site-card {
        flex-direction: column;
        gap: 1rem;
    }
    
    .history-score {
        width: 100%;
        height: 60px;
        justify-content: center;
    }
    
    /* URL Input Rows */
    .url-input-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .url-input-row button {
        width: 100%;
    }
}

/* Small devices only */
@media (max-width: 480px) {
    .nav-brand,
    .logo {
        font-size: 1rem !important;
    }
    
    .welcome-text h1 {
        font-size: 1.25rem !important;
    }
    
    .stat-card .value {
        font-size: 1.75rem !important;
    }
    
    .stats-row {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 1.5rem !important;
    }
}

/* Desktop (1024px+) - Reset mobile styles */
@media (min-width: 768px) {
    .hamburger-btn {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
    }
    
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}
