/* ===== ADDITIONAL MOBILE RESPONSIVE IMPROVEMENTS ===== */
/* Enhancements for various mobile landscape scenarios */

/* ===== GENERAL MOBILE LANDSCAPE IMPROVEMENTS ===== */
@media (max-width: 1024px) and (orientation: landscape) {
    
    /* ===== IMPROVED NAVIGATION FOR LANDSCAPE ===== */
    .nav-menu {
        max-height: calc(100vh - var(--mobile-landscape-header-height));
        overflow-y: auto;
    }
    
    .quick-action-btn {
        padding: 8px 10px;
        min-height: 40px;
    }
    
    .action-label {
        font-size: 0.8rem;
    }
    
    /* ===== IMPROVED CARD LAYOUTS ===== */
    .card {
        margin-bottom: 8px;
    }
    
    .card-content {
        padding: 8px;
    }
    
    /* ===== IMPROVED BUTTON LAYOUTS ===== */
    .button-group {
        display: flex;
        flex-direction: row;
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .button-group .button {
        flex: 1;
        min-width: 0;
    }
    
    /* ===== IMPROVED FORM LAYOUTS ===== */
    .form-row {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    
    .form-row .form-group {
        flex: 1;
        margin-bottom: 0;
    }
    
    /* ===== IMPROVED GRID LAYOUTS ===== */
    .grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    /* ===== IMPROVED TEXT LAYOUTS ===== */
    .text-truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .text-wrap {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* ===== IMPROVED SPACING ===== */
    .spacing-compact {
        margin: 4px 0;
        padding: 4px 0;
    }
    
    .spacing-tight {
        margin: 2px 0;
        padding: 2px 0;
    }
}

/* ===== SPECIFIC MOBILE LANDSCAPE BREAKPOINTS ===== */

/* Small Mobile Landscape (320px - 480px width, landscape) */
@media (max-width: 480px) and (orientation: landscape) {
    
    /* Ultra-compact layouts for very small screens */
    .hero-content {
        gap: 6px;
    }
    
    .welcome-message h1 {
        font-size: 0.9rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 0.7rem;
    }
    
    .hero-actions {
        min-width: 100px;
    }
    
    .hero-actions .button {
        padding: 4px 6px;
        font-size: 0.65rem;
        min-height: 24px;
    }
    
    .character-display {
        gap: 6px;
    }
    
    .avatar-circle {
        width: 40px;
        height: 40px;
    }
    
    .avatar-icon {
        width: 20px;
        height: 20px;
    }
    
    .character-name {
        font-size: 0.9rem;
    }
    
    .character-level {
        font-size: 0.7rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .features-grid-premium {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .feature-card,
    .feature-card-premium {
        padding: 6px;
    }
    
    .feature-card h3,
    .feature-card-premium h3 {
        font-size: 0.8rem;
    }
    
    .feature-card p,
    .feature-description {
        font-size: 0.7rem;
    }
}

/* Medium Mobile Landscape (481px - 768px width, landscape) */
@media (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
    
    /* Balanced layouts for medium screens */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .features-grid-premium {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .hero-visual-showcase {
        width: 100px;
    }
    
    .showcase-container {
        height: 100px;
    }
    
    .action-card {
        width: 25px;
        height: 25px;
        font-size: 0.55rem;
    }
}

/* Large Mobile Landscape (769px - 896px width, landscape) */
@media (min-width: 769px) and (max-width: 896px) and (orientation: landscape) {
    
    /* More spacious layouts for larger mobile screens */
    .hero-content-wrapper {
        gap: 20px;
    }
    
    .hero-description {
        flex: 1.2;
    }
    
    .hero-visual-showcase {
        flex: 0.8;
        width: 140px;
    }
    
    .showcase-container {
        height: 140px;
    }
    
    .action-card {
        width: 35px;
        height: 35px;
        font-size: 0.7rem;
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .features-grid-premium {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ===== HEIGHT-BASED BREAKPOINTS ===== */

/* Very Short Landscape (height < 350px) */
@media (orientation: landscape) and (max-height: 350px) {
    
    .home-container {
        height: calc(100vh - 40px);
    }
    
    :root {
        --mobile-landscape-header-height: 35px;
        --mobile-landscape-padding: 6px;
        --mobile-landscape-gap: 4px;
    }
    
    .welcome-hero {
        padding: 6px;
        margin-bottom: 4px;
    }
    
    .hero-content {
        gap: 4px;
    }
    
    .welcome-message h1 {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }
    
    .hero-subtitle {
        font-size: 0.7rem;
    }
    
    .hero-actions {
        min-width: 80px;
    }
    
    .hero-actions .button {
        padding: 3px 5px;
        font-size: 0.6rem;
        min-height: 20px;
    }
    
    .character-card {
        padding: 6px;
        margin-bottom: 4px;
    }
    
    .character-display {
        gap: 4px;
    }
    
    .avatar-circle {
        width: 35px;
        height: 35px;
    }
    
    .avatar-icon {
        width: 18px;
        height: 18px;
    }
    
    .dashboard-grid,
    .features-grid,
    .features-grid-premium {
        gap: 4px;
    }
    
    .dashboard-card,
    .feature-card,
    .feature-card-premium {
        padding: 6px;
    }
}

/* Short Landscape (height 350px - 450px) */
@media (orientation: landscape) and (min-height: 350px) and (max-height: 450px) {
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .features-grid-premium {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Medium Landscape (height 450px - 550px) */
@media (orientation: landscape) and (min-height: 450px) and (max-height: 550px) {
    
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .features-grid-premium {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ===== TOUCH AND INTERACTION IMPROVEMENTS ===== */
@media (orientation: landscape) {
    
    /* Larger touch targets for landscape */
    .button,
    .card,
    .feature-card,
    .dashboard-card {
        min-height: 32px;
        touch-action: manipulation;
    }
    
    /* Improved scrolling */
    .home-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Better focus states for keyboard navigation */
    .button:focus,
    .card:focus,
    input:focus,
    textarea:focus,
    select:focus {
        outline: 2px solid var(--aura-gold);
        outline-offset: 2px;
    }
    
    /* Improved hover states for touch devices */
    @media (hover: hover) {
        .button:hover,
        .card:hover,
        .feature-card:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS FOR LANDSCAPE ===== */
@media (orientation: landscape) {
    
    /* Ensure sufficient color contrast */
    .text-muted {
        opacity: 0.8;
    }
    
    /* Improve focus visibility */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    
    /* Better text sizing for readability */
    .small-text {
        font-size: 0.8rem;
    }
    
    .large-text {
        font-size: 1.1rem;
    }
    
    /* Improved spacing for readability */
    .readable-spacing {
        line-height: 1.5;
        margin-bottom: 8px;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS FOR LANDSCAPE ===== */
@media (orientation: landscape) {
    
    /* Reduce animations for better performance */
    .floating-particle,
    .magic-circle,
    .hero-bg-elements {
        animation-duration: 0.5s;
        animation-iteration-count: 1;
    }
    
    /* Optimize transforms */
    .button,
    .card,
    .feature-card {
        will-change: transform;
        transform: translateZ(0);
    }
    
    /* Reduce backdrop filters for performance */
    .card,
    .feature-card,
    .dashboard-card {
        backdrop-filter: blur(2px);
    }
}

/* ===== PRINT STYLES FOR LANDSCAPE ===== */
@media print and (orientation: landscape) {
    
    .home-container {
        height: auto;
        overflow: visible;
    }
    
    .hero-actions,
    .cta-buttons-premium,
    .final-cta-buttons {
        display: none;
    }
    
    .card,
    .feature-card,
    .dashboard-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .fantasy-background {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
