/* =============================================
   DRIVEFOCUS - TABLET/IPAD RESPONSIVE FIX v8
   Place AFTER styles.css in your HTML
   Activates on tablets (769px - 1366px) - covers iPad landscape
============================================== */

@media screen and (min-width: 769px) and (max-width: 1366px) {
    
    /* ===========================================
       HOME SCREEN
    =========================================== */
    
    #screen-home {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 120px;
        padding-bottom: 40px;
        overflow-y: auto;
        gap: 20px;
    }
    
    .brand-header {
        position: fixed;
        top: 15px;
        left: 15px;
        right: 15px;
        transform: none;
        padding: 10px 16px;
        gap: 10px;
        z-index: 200;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .brand-logo {
        width: 28px;
        height: 28px;
    }
    
    .brand-name {
        font-size: 16px;
    }
    
    .user-info {
        margin-left: auto;
        gap: 10px;
    }
    
    .rev-cluster {
        width: 180px;
        height: 180px;
        min-width: 180px;
        min-height: 180px;
        max-width: 180px;
        max-height: 180px;
        margin-top: 15px;
        margin-bottom: 15px;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
    }
    
    .rev-outer,
    .rev-inner {
        border-radius: 50% !important;
    }
    
    .rev-value {
        font-size: 32px;
    }
    
    .rev-label {
        font-size: 9px;
    }
    
    .rev-display {
        bottom: 30px;
    }
    
    .rev-needle {
        height: 55px;
        width: 4px;
    }
    
    .home-tagline {
        font-size: 11px;
        letter-spacing: 3px;
        margin-bottom: 15px;
    }
    
    .home-stats {
        padding: 18px 25px;
        gap: 20px;
    }
    
    .home-stat-icon {
        font-size: 20px;
    }
    
    .home-stat-value {
        font-size: 18px;
    }
    
    .home-stat-label {
        font-size: 9px;
    }
    
    .stats-week-label {
        font-size: 10px;
        margin-bottom: 20px;
    }
    
    .btn-enter {
        padding: 16px 40px;
        font-size: 13px;
    }
    
    /* ===========================================
       NAVIGATION
    =========================================== */
    
    .top-nav {
        height: 60px;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .nav-tab {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .back-btn {
        top: 65px;
        left: 15px;
        padding: 10px 14px;
        font-size: 12px;
    }
    
    /* ===========================================
       CARD SELECTOR
    =========================================== */
    
    .card-selector {
        bottom: 80px;
        padding: 20px 25px 15px;
        gap: 16px;
    }
    
    .select-card {
        width: 180px;
        height: 250px;
        min-width: 180px;
    }
    
    .select-card.active {
        width: 220px;
        height: 290px;
        min-width: 220px;
    }
    
    .select-card-title {
        font-size: 15px;
    }
    
    .select-card.active .select-card-title {
        font-size: 18px;
    }
    
    .select-card-content {
        padding: 16px;
    }
    
    /* ===========================================
       DRIVE SCREEN
    =========================================== */
    
    #screen-drive .back-btn {
        top: 80px;
        left: 15px;
    }
    
    .drive-route-info {
        top: 15px;
        left: 15px;
        padding: 12px 16px;
        gap: 10px;
        max-width: 220px;
    }
    
    .route-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .route-text h3 {
        font-size: 14px;
    }
    
    .route-text p {
        font-size: 10px;
    }
    
    .drive-status {
        top: 15px;
        right: 15px;
        gap: 10px;
    }
    
    .status-badge {
        padding: 10px 16px;
    }
    
    .status-text {
        font-size: 11px;
    }
    
    .speed-limit {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-width: 5px;
    }
    
    /* Speed panel - LEFT BOTTOM */
    .speed-panel {
        position: absolute;
        left: 15px;
        right: auto;
        bottom: 20px;
        padding: 14px 18px;
        gap: 16px;
        max-width: 50%;
    }
    
    .speed-value {
        font-size: 42px;
    }
    
    .speed-unit {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 8px;
    }
    
    .stat-divider {
        height: 35px;
    }
    
    /* Volume/Settings - LEFT, above speed */
    .control-panel {
        position: absolute;
        left: 15px;
        bottom: 110px;
        right: auto;
        gap: 10px;
        flex-direction: row;
    }
    
    .control-btn {
        width: 46px;
        height: 46px;
    }
    
    .control-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Pause button - show next to settings */
    .btn-pause {
        display: flex !important;
        width: 46px;
        height: 46px;
        font-size: 18px;
    }
    
    .btn-pause.visible {
        display: flex !important;
    }
    
    /* Ambient sounds - RIGHT BOTTOM */
    .ambient-selector {
        position: absolute;
        bottom: 20px;
        right: 15px;
        left: auto;
        transform: none;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .ambient-label {
        display: none;
    }
    
    .ambient-buttons {
        padding: 10px 16px;
        gap: 12px;
    }
    
    .ambient-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    
    /* Volume control - larger touch targets for iPad */
    .ambient-volume-control {
        padding: 12px 18px;
        border-radius: 25px;
        margin-top: 8px;
        pointer-events: auto !important;
    }
    
    .ambient-volume-slider {
        width: 140px;
        height: 8px;
        -webkit-appearance: none;
        appearance: none;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
        cursor: pointer;
        pointer-events: auto !important;
    }
    
    .ambient-volume-slider::-webkit-slider-runnable-track {
        height: 8px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }
    
    .ambient-volume-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 32px;
        height: 32px;
        background: #e91e63;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(233, 30, 99, 0.5);
        margin-top: -12px;
        pointer-events: auto !important;
    }
    
    .ambient-volume-slider::-moz-range-thumb {
        width: 32px;
        height: 32px;
        background: #e91e63;
        border: none;
        border-radius: 50%;
        cursor: pointer;
    }
    
    .ambient-volume-slider::-moz-range-track {
        height: 8px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }
    
    /* Start Focus button - RIGHT, above ambient */
    .btn-drive {
        position: fixed !important;
        bottom: 110px !important;
        right: 15px !important;
        left: auto !important;
        transform: none !important;
        padding: 14px 28px;
        font-size: 13px;
        z-index: 110;
        transition: bottom 0.3s ease !important;
    }
    
    /* Move END SESSION button UP when volume slider is visible */
    .btn-drive.volume-active {
        bottom: 160px !important;
    }
    
    .focus-goal-bar {
        top: 85px !important;
        left: 15px;
        width: 170px;
        height: 22px;
        transform: none;
    }
    
    .goal-text {
        font-size: 9px;
    }
    
    #screen-drive .back-btn {
        top: 115px !important;
        left: 15px;
    }
    
    .car-avatar {
        width: 65px;
        left: calc(50% - 32px);
        top: 45%;
    }
    
    /* ===========================================
       MODALS
    =========================================== */
    
    .modal-panel,
    .settings-panel,
    .car-shop-content,
    .credit-shop-content,
    .session-summary-content,
    .pause-warning-content {
        width: 90%;
        max-width: 450px;
        max-height: 85vh;
    }
    
    .auth-container {
        width: 90%;
        max-width: 420px;
        padding: 35px 30px;
    }
    
    .goal-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .goal-option {
        padding: 14px 10px;
        font-size: 14px;
    }
    
    .car-shop-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 20px;
    }
    
    .credit-packages {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}