/* Palette AI - Tablet Styles (768px - 1023px) */
/* iPad, Android tablets, landscape phones */

@media (min-width: 768px) and (max-width: 1023px) {
    
    /* ========================================================================
       LAYOUT ADJUSTMENTS
       ======================================================================== */
    
    /* Sidebar - Narrower on tablets */
    .sidebar {
        width: 200px;
    }
    
    .app-container {
        grid-template-columns: 200px 1fr 0px;
    }
    
    /* Artifact pane - Overlay mode on tablets */
    .app-container.artifacts-open {
        grid-template-columns: 200px 1fr 0px; /* Don't split screen */
    }
    
    .app-container.artifacts-open .artifact-pane {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 60%;
        max-width: 500px;
        z-index: 1000;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
        animation: slideInRight 0.3s ease;
    }
    
    @keyframes slideInRight {
        from {
            transform: translateX(100%);
        }
        to {
            transform: translateX(0);
        }
    }
    
    /* Backdrop for artifact pane */
    .app-container.artifacts-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }
    
    /* ========================================================================
       HEADER ADJUSTMENTS
       ======================================================================== */
    
    .app-header-center {
        /* Model selector stays centered */
        flex: 1;
    }
    
    .model-selector-btn {
        min-width: 160px;
        max-width: 200px;
    }
    
    /* ========================================================================
       POPUPS - Adjust sizes for tablets
       ======================================================================== */
    
    .analytics-popup,
    .account-popup,
    .settings-popup,
    .compare-popup,
    .conversation-details-popup {
        width: 400px;
        max-width: 50vw;
    }
    
    .model-selector-popup {
        width: 320px;
    }
    
    /* ========================================================================
       CONVERSATIONS SIDEBAR
       ======================================================================== */
    
    .conversation-item {
        padding: 8px 10px;
    }
    
    .conversation-title {
        font-size: 13px;
    }
    
    .new-conversation-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* ========================================================================
       CHAT AREA
       ======================================================================== */
    
    .message-content {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    /* ========================================================================
       FORMS & INPUTS
       ======================================================================== */
    
    .setting-input,
    .setting-select {
        font-size: 14px;
        padding: 7px 10px;
    }
    
    /* ========================================================================
       CODE BLOCKS
       ======================================================================== */
    
    .code-block-wrapper pre {
        font-size: 12px;
    }
    
    /* ========================================================================
       ANALYTICS CHARTS
       ======================================================================== */
    
    .chart-canvas {
        max-height: 220px;
    }
    
    .sparkline-container {
        gap: 10px;
    }
    
    /* ========================================================================
       API KEY CARDS
       ======================================================================== */
    
    .api-key-cards-grid {
        grid-template-columns: 1fr;
    }
    
    /* ========================================================================
       BUTTONS - Slightly larger for touch
       ======================================================================== */
    
    .header-icon-btn {
        min-width: 40px;
        min-height: 40px;
    }
    
    .chat-header-btn {
        min-width: 36px;
        min-height: 36px;
    }
}

/* ========================================================================
   TABLET LANDSCAPE SPECIFIC (wider tablets in landscape)
   ======================================================================== */

@media (min-width: 1024px) and (max-width: 1200px) and (orientation: landscape) {
    
    /* Slightly wider sidebar for landscape tablets */
    .sidebar {
        width: 220px;
    }
    
    .app-container {
        grid-template-columns: 220px 1fr 0px;
    }
    
    /* Artifact pane can be wider in landscape */
    .app-container.artifacts-open .artifact-pane {
        width: 50%;
        max-width: 600px;
    }
}