/**
 * Main Stylesheet
 * Global styles and theme variables
 */

/* Theme Variables */
:root {
    --bg-light: #f3f4f6;
    --bg-dark: #1f2937;
    --card-light: #ffffff;
    --card-dark: #111827;
    --text-light: #111827;
    --text-dark: #f3f4f6;
    --border-light: #e5e7eb;
    --border-dark: #374151;
}

/* Dark mode support */
.dark {
    color-scheme: dark;
}

/* Base styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* Utility classes */
.action-button {
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.action-button:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4f46e5;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* CodeMirror styling (for code editor) */
.CodeMirror {
    border: 1px solid #ccc;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0.5rem;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.CodeMirror-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.CodeMirror-sizer {
    min-width: 0 !important;
}

.dark .CodeMirror {
    border-color: #4b5563;
}

/* Code Editor Container */
#codeEditorContainer {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Editor and Preview Layout */
#codeEditorContainer .flex {
    min-width: 0;
}

#codeEditorContainer .flex-1 {
    min-width: 0;
    max-width: 100%;
}

#codeEditorContainer .lg\:w-1\/2 {
    min-width: 0;
    max-width: 50%;
}

/* File Explorer Styles */
.mobile-portrait #previewIframe {
    width: 375px;
    height: 667px;
    max-width: 100%;
}

.mobile-landscape #previewIframe {
    width: 667px;
    height: 375px;
    max-width: 100%;
    max-height: 100%;
}

.folder-item {
    user-select: none;
}

.folder-row {
    transition: background-color 0.2s;
}

.folder-toggle svg {
    transition: transform 0.2s;
}

.folder-toggle.rotate-90 svg {
    transform: rotate(90deg);
}

.file-item {
    transition: transform 0.2s;
}

.file-item:hover {
    transform: translateY(-2px);
}

.empty-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Context Menu Styles */
.context-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    color: #374151;
    transition: background-color 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.dark .context-menu-item {
    color: #f3f4f6;
}

.context-menu-item:hover {
    background-color: #f3f4f6;
}

.dark .context-menu-item:hover {
    background-color: #374151;
}

/* Loading inline styles */
.loading-inline {
    min-height: 200px;
}

/* Mobile Sidebar Styles */
.mobile-hidden {
    display: none;
}

@media (min-width: 1024px) {
    .mobile-hidden.lg\:block {
        display: block;
    }
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }
    
    /* Better touch targets on mobile */
    button, .file-item, .folder-item-main {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Larger text on mobile */
    .text-xs {
        font-size: 0.75rem;
    }
}

