/* Responsive Styles for n8n Workflow Viewer */

/* Tablet - Medium Screens (768px - 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    
    main {
        padding: 1rem;
    }
    
    .workflow-viewer {
        height: 500px;
    }
}

/* Mobile - Small Screens (less than 768px) */
@media (max-width: 767px) {
    /* Mobile Navigation */
    body {
        overflow-x: hidden;
    }
    
    .flex {
        flex-direction: column;
    }
    
    /* Sidebar becomes full width on mobile */
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    /* Main content adjustments */
    main {
        width: 100%;
        padding: 1rem;
    }
    
    /* Workflow viewer mobile height */
    .workflow-viewer {
        height: 400px;
    }
    
    /* Header mobile adjustments */
    header h1 {
        font-size: 1.25rem;
    }
    
    /* Hide icon text on mobile */
    header h1 i {
        margin-right: 0.5rem;
    }
    
    /* Workflow container mobile */
    #workflowContainer {
        padding: 0.5rem;
    }
    
    /* Button group mobile */
    #workflowContainer .flex.space-x-2 {
        flex-direction: column;
        space-y: 0.5rem;
    }
    
    #workflowContainer button {
        width: 100%;
        justify-content: center;
    }
    
    /* Workflow info mobile */
    #workflowInfo h2 {
        font-size: 1.5rem;
    }
    
    /* Workflow item mobile */
    .workflow-item {
        padding: 0.75rem;
    }
    
    .workflow-item h4 {
        font-size: 0.875rem;
    }
    
    .workflow-item p {
        font-size: 0.75rem;
    }
}

/* Very small screens (less than 480px) */
@media (max-width: 480px) {
    /* Header adjustments */
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Workflow viewer height for very small screens */
    .workflow-viewer {
        height: 350px;
    }
    
    /* Notification position */
    .fixed.bottom-4.right-4 {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        right: 1rem;
    }
    
    /* Empty state mobile */
    #emptyState {
        padding: 3rem 1rem;
    }
    
    #emptyState i {
        font-size: 3rem;
    }
    
    #emptyState h3 {
        font-size: 1rem;
    }
}

/* Print styles */
@media print {
    /* Hide unnecessary elements */
    .sidebar,
    header,
    button,
    .fixed {
        display: none !important;
    }
    
    /* Full width for main content */
    main {
        width: 100%;
        padding: 0;
    }
    
    /* Workflow viewer print size */
    .workflow-viewer {
        height: auto;
        page-break-inside: avoid;
    }
    
    /* Remove shadows and borders for print */
    #workflowContainer {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .workflow-item.active {
        border-left-width: 5px;
    }
    
    .workflow-viewer {
        border: 2px solid #000;
    }
    
    button {
        border: 2px solid currentColor;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1f2937;
    }
    
    .bg-white {
        background-color: #111827;
    }
    
    .bg-gray-50 {
        background-color: #1f2937;
    }
    
    .text-gray-900 {
        color: #f9fafb;
    }
    
    .text-gray-800 {
        color: #e5e7eb;
    }
    
    .text-gray-600 {
        color: #9ca3af;
    }
    
    .text-gray-500 {
        color: #6b7280;
    }
    
    .border-gray-200 {
        border-color: #374151;
    }
    
    .hover\:bg-gray-50:hover {
        background-color: #374151;
    }
    
    .workflow-viewer {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    /* Scrollbar dark mode */
    .sidebar::-webkit-scrollbar-track {
        background: #374151;
    }
    
    .sidebar::-webkit-scrollbar-thumb {
        background: #6b7280;
    }
    
    .sidebar::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: calc(100vh - 3rem);
        max-height: none;
    }
    
    .workflow-viewer {
        height: calc(100vh - 8rem);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .workflow-item {
        min-height: 60px;
    }
    
    button {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .workflow-item:hover {
        transform: none;
    }
}