/* ===== MOBILE LANDSCAPE OPTIMIZATION ===== */
/* Specifically for mobile devices in landscape orientation on smaller screens */

/* Mobile Landscape Breakpoint - Small screens in landscape */
@media (max-width: 896px) and (orientation: landscape) and (max-height: 500px) {
    
    /* ===== ROOT VARIABLES FOR MOBILE LANDSCAPE ===== */
    :root {
        --mobile-landscape-header-height: 50px;
        --mobile-landscape-padding: 12px;
        --mobile-landscape-gap: 8px;
        --mobile-landscape-font-scale: 0.9;
    }
    
    /* ===== GLOBAL LAYOUT ADJUSTMENTS ===== */
    body {
        font-size: calc(1rem * var(--mobile-landscape-font-scale));
    }
    
    main {
        padding-top: calc(var(--mobile-landscape-header-height) + var(--mobile-landscape-padding));
        padding-bottom: var(--mobile-landscape-padding);
        padding-left: var(--mobile-landscape-padding);
        padding-right: var(--mobile-landscape-padding);
        min-height: calc(100vh - var(--mobile-landscape-header-height));
    }
    
    /* ===== HEADER OPTIMIZATION ===== */
    header {
        height: var(--mobile-landscape-header-height);
        padding: 0 var(--mobile-landscape-padding);
    }
    
    header nav {
        gap: var(--mobile-landscape-gap);
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .logo-text {
        font-size: 14px;
        letter-spacing: 0.5px;
    }
    
    .character-name,
    .username {
        font-size: 11px;
        max-width: 60px;
    }
    
    .gold-count {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    /* ===== HOME PAGE LANDSCAPE LAYOUT ===== */
    .home-container {
        padding: 0;
        max-width: 100%;
        height: calc(100vh - var(--mobile-landscape-header-height));
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* ===== WELCOME HERO - LANDSCAPE LAYOUT ===== */
    .welcome-hero {
        margin-bottom: var(--mobile-landscape-gap);
        padding: var(--mobile-landscape-padding);
        background: rgba(0, 0, 0, 0.3);
        border-radius: var(--radius-md);
        border: 1px solid rgba(212, 180, 131, 0.2);
    }
    
    .hero-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--mobile-landscape-padding);
        min-height: auto;
    }
    
    .welcome-message {
        flex: 1;
        text-align: left;
    }
    
    .welcome-message h1 {
        font-size: 1.2rem;
        margin-bottom: 4px;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.8rem;
        margin-bottom: 0;
        opacity: 0.8;
    }
    
    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 120px;
    }
    
    .hero-actions .button {
        padding: 8px 12px;
        font-size: 0.75rem;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
    
    .hero-actions .button-icon {
        width: 14px;
        height: 14px;
    }
    
    /* ===== CHARACTER CARD - LANDSCAPE LAYOUT ===== */
    .character-card {
        margin-bottom: var(--mobile-landscape-gap);
        padding: var(--mobile-landscape-padding);
    }
    
    .character-display {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--mobile-landscape-padding);
    }
    
    .character-avatar {
        flex-shrink: 0;
    }
    
    .avatar-circle {
        width: 50px;
        height: 50px;
    }
    
    .avatar-icon {
        width: 24px;
        height: 24px;
    }
    
    .character-info {
        flex: 1;
        min-width: 0;
    }
    
    .character-name {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .character-level {
        font-size: 0.8rem;
        opacity: 0.8;
    }
    
    .character-summary {
        display: flex;
        flex-direction: row;
        gap: var(--mobile-landscape-gap);
        margin-top: 8px;
    }
    
    .char-stats {
        flex: 1;
        min-width: 0;
    }
    
    .stat-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2px;
        font-size: 0.75rem;
    }
    
    .stat-label {
        opacity: 0.8;
    }
    
    .stat-value {
        font-weight: bold;
        color: var(--aura-gold);
    }
    
    /* ===== DASHBOARD GRID - LANDSCAPE LAYOUT ===== */
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--mobile-landscape-gap);
        margin-bottom: var(--mobile-landscape-gap);
    }
    
    .dashboard-card {
        padding: var(--mobile-landscape-padding);
        min-height: auto;
    }
    
    .dashboard-card h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .dashboard-card p {
        font-size: 0.75rem;
        line-height: 1.3;
    }
    
    /* ===== ACTIVITY CARD - LANDSCAPE LAYOUT ===== */
    .activity-card {
        grid-column: span 2;
        padding: var(--mobile-landscape-padding);
    }
    
    .activity-card h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .activity-list {
        max-height: 120px;
        overflow-y: auto;
    }
    
    .activity-item {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 4px 0;
        font-size: 0.75rem;
    }
    
    .activity-icon {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    .activity-text {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .activity-time {
        font-size: 0.7rem;
        opacity: 0.6;
        flex-shrink: 0;
    }
    
    /* ===== FEATURES GRID - LANDSCAPE LAYOUT ===== */
    .features-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--mobile-landscape-gap);
        margin: var(--mobile-landscape-gap) 0;
    }
    
    .feature-card {
        padding: var(--mobile-landscape-padding);
        text-align: center;
    }
    
    .feature-card h3 {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .feature-card p {
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .feature-icon {
        width: 24px;
        height: 24px;
        margin: 0 auto 4px;
    }
    
    /* ===== HERO SECTION - LANDSCAPE LAYOUT ===== */
    .hero-section {
        min-height: auto;
        padding: var(--mobile-landscape-padding) 0;
    }
    
    .hero-content-wrapper {
        flex-direction: row;
        gap: var(--mobile-landscape-padding);
        padding: 0 var(--mobile-landscape-padding);
    }
    
    .hero-description {
        flex: 1;
        min-width: 0;
    }
    
    .main-hero-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
        line-height: 1.2;
    }
    
    .hero-story {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .hero-highlights {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .highlight-item {
        font-size: 0.7rem;
        padding: 2px 6px;
        background: rgba(212, 180, 131, 0.2);
        border-radius: var(--radius-sm);
    }
    
    .hero-cta-section {
        margin-top: 8px;
    }
    
    .cta-buttons-premium {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .cta-button-primary,
    .cta-button-secondary {
        padding: 8px 12px;
        font-size: 0.75rem;
        min-height: 32px;
    }
    
    .hero-visual-showcase {
        flex-shrink: 0;
        width: 120px;
    }
    
    .showcase-container {
        height: 120px;
        position: relative;
    }
    
    .floating-elements {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .action-card {
        position: absolute;
        width: 30px;
        height: 30px;
        font-size: 0.6rem;
        padding: 2px;
    }
    
    .action-card.card-magic { top: 10px; left: 10px; }
    .action-card.card-explore { top: 50px; right: 10px; }
    .action-card.card-social { bottom: 10px; left: 50%; transform: translateX(-50%); }
    
    /* ===== FEATURES SHOWCASE - LANDSCAPE LAYOUT ===== */
    .features-showcase-section {
        padding: var(--mobile-landscape-padding) 0;
    }
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 4px;
        text-align: center;
    }
    
    .section-subtitle {
        font-size: 0.8rem;
        margin-bottom: var(--mobile-landscape-padding);
        text-align: center;
        opacity: 0.8;
    }
    
    .features-grid-premium {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--mobile-landscape-gap);
        padding: 0 var(--mobile-landscape-padding);
    }
    
    .feature-card-premium {
        padding: var(--mobile-landscape-padding);
    }
    
    .feature-card-premium h3 {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    
    .feature-description {
        font-size: 0.75rem;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .feature-highlights {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .highlight-tag {
        font-size: 0.65rem;
        padding: 2px 4px;
        background: rgba(212, 180, 131, 0.2);
        border-radius: var(--radius-sm);
    }
    
    /* ===== SCROLL INDICATOR - HIDDEN IN LANDSCAPE ===== */
    .scroll-indicator {
        display: none;
    }
    
    /* ===== BUTTON OPTIMIZATIONS ===== */
    .button {
        padding: 6px 10px;
        font-size: 0.75rem;
        min-height: 28px;
    }
    
    .button.large {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    .button-icon {
        width: 14px;
        height: 14px;
    }
    
    /* ===== CARD OPTIMIZATIONS ===== */
    .card {
        padding: var(--mobile-landscape-padding);
        border-radius: var(--radius-md);
    }
    
    .card-header h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    /* ===== FORM OPTIMIZATIONS ===== */
    input, textarea, select {
        padding: 6px 8px;
        font-size: 0.8rem;
        min-height: 28px;
    }
    
    /* ===== UTILITY CLASSES FOR LANDSCAPE ===== */
    .mobile-landscape-hidden {
        display: none !important;
    }
    
    .mobile-landscape-flex {
        display: flex !important;
    }
    
    .mobile-landscape-grid {
        display: grid !important;
    }
    
    .mobile-landscape-text-center {
        text-align: center !important;
    }
    
    .mobile-landscape-text-left {
        text-align: left !important;
    }
    
    /* ===== SCROLLBAR STYLING FOR LANDSCAPE ===== */
    .home-container::-webkit-scrollbar {
        width: 4px;
    }
    
    .home-container::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
    
    .home-container::-webkit-scrollbar-thumb {
        background: rgba(212, 180, 131, 0.5);
        border-radius: 2px;
    }
    
    .home-container::-webkit-scrollbar-thumb:hover {
        background: rgba(212, 180, 131, 0.7);
    }
    
    /* ===== ANIMATION OPTIMIZATIONS FOR LANDSCAPE ===== */
    .floating-particle,
    .magic-circle {
        display: none; /* Hide decorative elements in landscape */
    }
    
    /* Reduce animation intensity for better performance */
    .hero-bg-elements {
        opacity: 0.3;
    }
    
    /* ===== TOUCH OPTIMIZATIONS ===== */
    .button,
    .card,
    .feature-card,
    .dashboard-card {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(212, 180, 131, 0.2);
    }
    
    /* ===== SAFE AREA SUPPORT ===== */
    @supports (padding: max(0px)) {
        main {
            padding-left: max(var(--mobile-landscape-padding), env(safe-area-inset-left));
            padding-right: max(var(--mobile-landscape-padding), env(safe-area-inset-right));
        }
        
        header {
            padding-left: max(var(--mobile-landscape-padding), env(safe-area-inset-left));
            padding-right: max(var(--mobile-landscape-padding), env(safe-area-inset-right));
        }
    }
}

/* ===== ADDITIONAL MOBILE LANDSCAPE BREAKPOINTS ===== */

/* Very small landscape screens (height < 400px) */
@media (max-width: 896px) and (orientation: landscape) and (max-height: 400px) {
    :root {
        --mobile-landscape-header-height: 40px;
        --mobile-landscape-padding: 8px;
        --mobile-landscape-gap: 6px;
        --mobile-landscape-font-scale: 0.85;
    }
    
    .hero-content {
        gap: var(--mobile-landscape-gap);
    }
    
    .welcome-message h1 {
        font-size: 1rem;
    }
    
    .hero-subtitle {
        font-size: 0.75rem;
    }
    
    .hero-actions .button {
        padding: 6px 8px;
        font-size: 0.7rem;
        min-height: 28px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--mobile-landscape-gap);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--mobile-landscape-gap);
    }
    
    .features-grid-premium {
        grid-template-columns: 1fr;
        gap: var(--mobile-landscape-gap);
    }
}

/* Medium landscape screens (height 400px - 500px) */
@media (max-width: 896px) and (orientation: landscape) and (min-height: 400px) and (max-height: 500px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid-premium {
        grid-template-columns: repeat(2, 1fr);
    }
}
