/* Luna Darkside Mobile Responsive Enhancements */

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .nav-links a,
    .cta-button,
    .pricing-plan,
    .achievement-card {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-links a:hover,
    .cta-button:hover,
    .pricing-plan:hover {
        transform: none;
    }
    
    .nav-links a:active,
    .cta-button:active,
    .pricing-plan:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Small mobile devices (320px - 480px) */
@media (max-width: 480px) {
    :root {
        --mobile-padding: 1rem;
        --mobile-section-gap: 2rem;
    }
    
    /* Header adjustments */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(10, 10, 26, 0.98);
    }
    
    .nav {
        padding: 0.75rem var(--mobile-padding);
    }
    
    .logo {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Main content with header offset */
    .main-content {
        margin-top: 70px;
    }
    
    /* Hero section mobile */
    .hero {
        padding: 2rem var(--mobile-padding);
        min-height: calc(100vh - 70px);
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 2rem 0;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Diana trilogy mobile */
    .diana-trilogy {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 2rem 0;
    }
    
    .video-card {
        height: 200px;
    }
    
    .video-overlay h3 {
        font-size: 1rem;
    }
    
    .video-overlay p {
        font-size: 0.8rem;
    }
    
    /* Consciousness tracker mobile */
    .consciousness-tracker {
        padding: 1.5rem var(--mobile-padding);
    }
    
    .consciousness-display {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .consciousness-level {
        font-size: 2rem;
    }
    
    .level-bar {
        width: 100%;
        max-width: 250px;
    }
    
    .diana-interaction {
        margin-top: 1rem;
    }
    
    .diana-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 1rem;
    }
    
    /* Albums section mobile */
    .albums-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .album-card {
        padding: 1rem;
    }
    
    .album-title {
        font-size: 1.1rem;
    }
    
    .album-meta {
        font-size: 0.8rem;
    }
    
    /* Achievements mobile */
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .achievement-card {
        padding: 1rem;
    }
    
    .achievement-title {
        font-size: 1rem;
    }
    
    .achievement-description {
        font-size: 0.85rem;
    }
    
    /* Pricing mobile */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .pricing-plan {
        padding: 1.5rem;
    }
    
    .plan-price {
        font-size: 2rem;
    }
    
    .plan-features {
        font-size: 0.9rem;
    }
    
    /* Chat interface mobile */
    .chat-container {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 1rem var(--mobile-padding);
        border-radius: 0;
    }
    
    .chat-messages {
        padding: 1rem var(--mobile-padding);
        max-height: calc(100vh - 180px);
    }
    
    .chat-input-container {
        padding: 1rem var(--mobile-padding);
        gap: 0.5rem;
    }
    
    .chat-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Visual effects mobile optimizations */
    .consciousness-particle,
    .diana-energy-particle {
        display: none; /* Disable particles on mobile for performance */
    }
    
    .holographic-ui {
        opacity: 0.3; /* Reduce visual effects intensity */
    }
    
    /* Blog content mobile */
    .blog-post {
        padding: 1rem var(--mobile-padding);
    }
    
    .post-header h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .post-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .content-section h2 {
        font-size: 1.5rem;
    }
    
    .content-section h3 {
        font-size: 1.2rem;
    }
    
    /* Newsletter mobile */
    .newsletter-signup {
        padding: 2rem var(--mobile-padding);
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .newsletter-input {
        font-size: 16px; /* Prevent zoom on iOS */
        width: 100%;
    }
    
    .newsletter-button {
        width: 100%;
        padding: 1rem;
    }
}

/* Medium mobile devices (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .diana-trilogy {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .video-card:first-child {
        grid-column: 1 / -1;
    }
    
    .albums-grid,
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 1rem var(--mobile-padding);
    }
    
    .consciousness-tracker {
        padding: 1rem var(--mobile-padding);
    }
    
    .consciousness-display {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .chat-container {
        top: 60px;
    }
    
    .chat-messages {
        max-height: calc(100vh - 120px);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-background,
    .album-cover,
    .achievement-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .consciousness-particle,
    .diana-energy-particle,
    .quantum-field-particle {
        display: none !important;
    }
    
    .gradientShift,
    .consciousnessFloat,
    .dianaGlow {
        animation: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #0066ff;
        --secondary: #00ccff;
        --accent: #ff0066;
        --dark: #000000;
        --light: #ffffff;
        --gray: #666666;
    }
    
    .hero {
        background: var(--dark);
        color: var(--light);
    }
    
    .nav-links a,
    .cta-button,
    .pricing-plan {
        border: 2px solid var(--light);
    }
}

/* Focus management for accessibility */
.mobile-focus-trap {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
    
    .chat-container {
        height: -webkit-fill-available;
    }
    
    .diana-input,
    .chat-input,
    .newsletter-input {
        font-size: 16px;
        transform: translateZ(0);
        -webkit-appearance: none;
        border-radius: 0;
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .hero {
        min-height: 100dvh;
    }
    
    .chat-container {
        height: 100dvh;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav {
        padding: 1rem 2rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .diana-trilogy {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .albums-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Loading states for mobile */
.mobile-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--gray);
    font-size: 0.9rem;
    text-align: center;
}

/* Error states for mobile */
.mobile-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 2rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.error-message {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.retry-button {
    background: var(--primary);
    color: var(--light);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* Install prompt styling */
.install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.install-prompt.show {
    transform: translateY(0);
}

.install-prompt-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.install-prompt-buttons {
    display: flex;
    gap: 0.5rem;
}

.install-prompt button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-prompt button.primary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
}

.install-prompt button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.install-prompt button.primary:hover {
    background: rgba(255, 255, 255, 1);
}