/* Mobile First Responsive Design */

/* Hide Google Translate Widget on Mobile */
.goog-te-gadget {
    display: none !important;
}

@media (min-width: 768px) {
    .goog-te-gadget {
        display: block !important;
    }
}

/* Default mobile styles */
.hero-container {
    padding: 0 1rem;
}

.hero-buttons {
    flex-direction: column;
    gap: 1rem;
}

/* Hero Section */
.hero-search-form {
    width: 100%;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group:last-child {
    flex: 1;
}

.form-label {
    margin-bottom: 0.75rem;
}

.search-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Enhanced mobile navigation visibility */
.navbar-container {
    padding: 0 1rem;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/* Mobile navbar adjustments */
@media (max-width: 767px) {
    /* Ensure navbar has proper background on mobile */
    .navbar {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        position: fixed; /* Keep navbar fixed for mobile menu positioning */
    }
    
    /* Add padding to body to account for fixed navbar */
    body {
        padding-top: 80px;
    }
    
    @media (max-width: 480px) {
        body {
            padding-top: 70px;
        }
    }
}

.navbar-brand {
    font-size: 1rem;
}

.navbar-brand .brand-icon {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
}

/* Mobile navigation styles are now handled in main.css */

/* Better mobile spacing */
.navbar-menu li {
    margin: 0.4rem 0;
}

.navbar-menu a {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
}

.navbar-actions .btn,
.navbar-actions .city-indicator {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
}

.mobile-action-btn {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
}

.flower-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.bouquet-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.florist-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
}

.city-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Mobile Navigation - Updated for new structure */
.navbar-menu.desktop-menu {
    display: flex;
    position: static;
    background: transparent;
    flex-direction: row;
    padding: 0;
    box-shadow: none;
    border-top: none;
    max-height: none;
    overflow-y: visible;
    z-index: auto;
    border-radius: 0;
    max-width: 100%;
}

/* Mobile menu styles are now handled in main.css */

/* Desktop active state - no changes needed */

.navbar-menu li {
    margin: 0.75rem 0;
    width: 100%;
}

.navbar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    color: #2d3748;
    border: 1px solid transparent;
    min-height: 56px;
    white-space: nowrap;
    max-width: 100%;
}

.navbar-menu a:hover,
.navbar-menu a:focus {
    background: rgba(255, 107, 129, 0.08);
    border-color: rgba(255, 107, 129, 0.2);
    color: #FF6B81;
    transform: translateX(4px);
}

.navbar-menu a.active {
    background: linear-gradient(135deg, rgba(255, 107, 129, 0.1), rgba(255, 142, 158, 0.05));
    border-color: #FF6B81;
    color: #FF6B81;
    font-weight: 600;
}

/* Navbar toggle button styles are handled in main.css */

.navbar-actions.desktop-actions {
    display: flex;
    max-width: 100%;
}

/* Mobile actions are now handled in main.css */

/* Mobile action styles are now handled in main.css */

/* Mobile Navigation Close Button */
.navbar-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

/* Mobile Navigation Scroll Indicator */
.navbar-menu::-webkit-scrollbar {
    width: 4px;
}

.navbar-menu::-webkit-scrollbar-track {
    background: rgba(255, 107, 129, 0.1);
    border-radius: 2px;
}

.navbar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 129, 0.3);
    border-radius: 2px;
}

.navbar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 129, 0.5);
}

/* Mobile Navigation Styles */
@media (max-width: 767px) {
    .navbar-toggle {
        display: flex !important;
    }
    
    .desktop-menu,
    .desktop-actions {
        display: none !important;
    }
    
    .mobile-menu {
        display: none;
    }
    
    .mobile-menu.active {
        display: block;
    }
}

/* Tablet and Desktop Styles */
@media (min-width: 768px) {
    .hero-search-form {
        width: 100%;
    }
    
    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        gap: 1rem;
        align-items: end;
    }
    
    .form-group {
        flex: 1;
    }
    
    .form-group:last-child {
        flex: 0 0 auto;
    }
    
    .flower-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .bouquet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .florist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .city-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .navbar-menu {
        display: flex;
        position: static;
        background: none;
        box-shadow: none;
        border: none;
        padding: 0;
        flex-direction: row;
    }
    
    .navbar-toggle {
        display: none !important;
    }
    
    .desktop-menu,
    .desktop-actions {
        display: flex !important;
    }
    
    .navbar-actions {
        display: flex;
        position: static;
        background: none;
        box-shadow: none;
        border: none;
        padding: 0;
        flex-direction: row;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .hero-container {
        padding: 0;
    }
    
    .form-row {
        gap: 1.5rem;
    }
    
    .flower-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .bouquet-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .florist-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 3rem;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .flower-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .bouquet-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Large Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 4rem 0 2rem;
    }
    
    .hero-container {
        max-width: 600px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero::before {
        background-size: 10px 10px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-search,
    .btn,
    .city-modal {
        display: none !important;
    }
    
    .hero {
        background: white !important;
        color: black !important;
    }
    
    .flower-card,
    .bouquet-card,
    .florist-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero::before {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
    
    .navbar {
        background: rgba(26, 32, 44, 0.95);
        border-bottom-color: rgba(255, 107, 129, 0.2);
    }
    
    .hero {
        background: linear-gradient(135deg, rgba(255, 107, 129, 0.15), rgba(255, 142, 158, 0.08));
    }
    
    .hero-search,
    .flower-card,
    .bouquet-card,
    .florist-card {
        background: #2d3748;
        border-color: rgba(255, 107, 129, 0.2);
    }
    
    .form-input,
    .form-select {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-input::placeholder {
        color: #718096;
    }
    
    .city-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .city-item {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .city-item:hover {
        background: rgba(255, 107, 129, 0.1);
    }
    
    .city-item.selected {
        background: #FF6B81;
        color: white;
    }
}

/* Focus Management for Accessibility */
.btn:focus,
.form-input:focus,
.form-select:focus,
.city-item:focus {
    outline: 2px solid #FF6B81;
    outline-offset: 2px;
}

/* Keyboard Navigation Support */
.navbar-menu a:focus,
.footer-section a:focus {
    outline: 2px solid #FF6B81;
    outline-offset: 2px;
    border-radius: 4px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #FF6B81;
    }
    
    .flower-card,
    .bouquet-card,
    .florist-card {
        border: 2px solid #FF6B81;
    }
    
    .hero-search {
        border: 2px solid #FF6B81;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .city-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .form-input,
    .form-select {
        min-height: 44px;
    }
    
    .navbar-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Container Query Support (Future) */
@container (min-width: 400px) {
    .hero-search-form {
        grid-template-columns: 1fr 1fr auto;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #FF6B81;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FF8E9E;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #FF6B81;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #a0aec0;
}

/* Success/Error States */
.success-message {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid #48bb78;
    color: #22543d;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.error-message {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid #f56565;
    color: #742a2a;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.warning-message {
    background: rgba(237, 137, 54, 0.1);
    border: 1px solid #ed8936;
    color: #744210;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Enhanced Filter Mobile Responsiveness */
@media (max-width: 768px) {
    /* Ensure mobile navigation works properly */
    .navbar {
        height: 80px;
        display: flex;
        align-items: center;
    }
    
    .navbar-container {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        max-width: 100%;
    }
    
    /* Improve touch targets */
    .navbar-menu a,
    .navbar-actions .btn,
    .mobile-action-btn {
        min-height: 56px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        max-width: 100%;
    }
    
    /* Better mobile menu positioning */
    .navbar-menu,
    .navbar-actions.active,
    .mobile-actions.active {
        top: 80px;
        max-height: calc(100vh - 80px);
    }
    /* Hero filter improvements */
    .hero .filter-card {
        border-radius: 12px;
        margin: 0 0.5rem;
    }
    
    .hero .card-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    /* Better touch targets for mobile */
    .hero .chip {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .hero .segmented button {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .hero .browse-btn {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    /* Improved spacing for mobile */
    .hero .filter-item {
        margin-bottom: 0.5rem;
    }
    
    .hero .form-label {
        display: block;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screen optimizations */
    /* Mobile navigation improvements */
    .navbar {
        height: 70px;
    }
    
    /* Mobile menu styles are now handled in main.css */
    
    .navbar-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    
    /* Ensure no horizontal scroll on very small screens */
    .navbar-container {
        padding: 0 0.5rem;
    }
    
    .hero .filter-card {
        padding: 0.75rem;
        margin: 0 0.25rem;
    }
    
    .hero .card-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .hero .chip {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-height: 40px;
    }
    
    .hero .segmented button {
        padding: 0.4rem 0.3rem;
        font-size: 0.75rem;
        min-height: 40px;
    }
    
    .hero .browse-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Stack filter sections vertically with better spacing */
    .hero .filter-toolbar {
        gap: 0.75rem;
    }
    
    .hero .filter-item {
        margin-bottom: 0.25rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero .filter-card {
        padding: 0.75rem;
    }
    
    .hero .filter-toolbar {
        gap: 0.75rem;
    }
    
    .hero .chip {
        padding: 0.4rem 0.7rem;
    }
    
    .hero .segmented button {
        padding: 0.4rem 0.4rem;
    }
}

/* Ensure zoom-out effect works on all devices */
@media (max-width: 767px) {
    /* Mobile zoom effects */
    .flower-card:hover,
    .bouquet-card:hover,
    .florist-card:hover,
    .btn:hover,
    .chip:hover,
    .segmented button:hover,
    .browse-btn:hover,
    .navbar-menu a:hover,
    .city-item:hover {
        transform: scale(0.98);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    }
    
    .flower-card:active,
    .bouquet-card:active,
    .florist-card:active,
    .btn:active,
    .chip:active,
    .segmented button:active,
    .browse-btn:active,
    .navbar-menu a:active,
    .city-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

@media (max-width: 480px) {
    /* Small mobile zoom effects */
    .flower-card:hover,
    .bouquet-card:hover,
    .florist-card:hover,
    .btn:hover,
    .chip:hover,
    .segmented button:hover,
    .browse-btn:hover,
    .navbar-menu a:hover,
    .city-item:hover {
        transform: scale(0.99);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}
