/* GitHub README Generator - Styles */

/* Base styles */
.app {
    display: flex;
    height: 100vh;
    background: #0d1117;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
}

/* Desktop layout - ensure original flex behavior */
@media (min-width: 769px) {
    .app {
        display: flex !important;
        flex-direction: row !important;
    }
}

/* Tailwind CSS Custom Configuration */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px #58a6ff; }
    50% { box-shadow: 0 0 20px #58a6ff, 0 0 30px #58a6ff; }
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* GitHub Markdown Styling */
.github-markdown {
    color: #e6edf3;
    background-color: #0d1117;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.github-markdown h1, .github-markdown h2, .github-markdown h3 {
    border-bottom: 1px solid #30363d;
    padding-bottom: 0.3em;
    margin-bottom: 16px;
    margin-top: 24px;
}

.github-markdown h1 { font-size: 2em; }
.github-markdown h2 { font-size: 1.5em; }
.github-markdown h3 { font-size: 1.25em; }

.github-markdown img {
    max-width: 100%;
    height: auto;
}

.github-markdown code {
    background-color: rgba(110,118,129,0.4);
    border-radius: 6px;
    font-size: 85%;
    margin: 0;
    padding: 0.2em 0.4em;
}

.github-markdown pre {
    background-color: #161b22;
    border-radius: 6px;
    font-size: 85%;
    line-height: 1.45;
    overflow: auto;
    padding: 16px;
}

/* Custom Animations */
.pulse-neon {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

/* Drag and Drop Styles */
.drag-over {
    border: 2px dashed #39ff14;
    background-color: rgba(57, 255, 20, 0.1);
}

.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #161b22;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #39ff14;
}

/* Landscape Notice - Default hidden */
.landscape-notice {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0d1117;
    color: #e6edf3;
    z-index: 10000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
}

.landscape-notice .rotate-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: rotate 2s linear infinite;
    display: block;
}

.landscape-notice h2 {
    color: #e6edf3 !important;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.landscape-notice p {
    color: #8b949e !important;
    margin-bottom: 1rem;
    max-width: 300px;
    line-height: 1.5;
    display: block;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Default state - hide landscape notice */


/* Mobile Portrait - Show landscape notice */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .landscape-notice {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #0d1117 !important;
        color: #ffffff !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 99999 !important;
        text-align: center !important;
        padding: 2rem !important;
        box-sizing: border-box !important;
    }
    
    .landscape-notice .rotate-icon {
        font-size: 4rem !important;
        margin-bottom: 1rem !important;
        animation: rotate 2s linear infinite !important;
        display: block !important;
    }
    
    .landscape-notice h2 {
        color: #ffffff !important;
        font-size: 1.8rem !important;
        margin-bottom: 1rem !important;
        font-weight: bold !important;
        display: block !important;
    }
    
    .landscape-notice p {
        color: #8b949e !important;
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
        max-width: 300px !important;
        line-height: 1.5 !important;
        display: block !important;
    }
    
    #root {
        display: none !important; /* Hide app in portrait to show notice */
    }
    
    /* Mobile Portrait optimizations */
    .app {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        height: 40vh;
        position: relative;
        overflow-y: auto;
        background: #161b22;
        border-bottom: 1px solid #30363d;
    }
    
    .main-content {
        flex: 1;
        height: 60vh;
        overflow-y: auto;
        padding: 0.5rem;
    }
    
    .canvas {
        min-height: auto;
        padding: 0.5rem;
    }
    
    /* Make components more compact on mobile portrait */
    .section-card {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }
    
    .toolbar {
        padding: 0.5rem;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .toolbar button {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-height: 36px;
    }
}

/* Mobile Landscape - Optimized layout */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .landscape-notice {
        display: none !important;
    }
    
    #root {
        display: block !important;
    }
    
    .app {
        display: flex !important;
        flex-direction: row !important;
        height: 100vh;
    }
    
    /* Optimize layout for mobile landscape */
    .sidebar {
        width: 280px;
        height: 100vh;
        position: relative;
        overflow-y: auto;
        background: #161b22;
        border-right: 1px solid #30363d;
    }
    
    .main-content {
        flex: 1;
        height: 100vh;
        overflow-y: auto;
        padding: 0.5rem;
    }
    
    .canvas {
        min-height: calc(100vh - 60px);
        touch-action: pan-y;
        padding: 0.5rem;
    }
    
    /* Touch-friendly drag handles */
    .drag-handle {
        padding: 12px;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Larger touch targets */
    .section-card {
        min-height: 60px;
        margin-bottom: 8px;
        border-width: 2px;
    }
    
    .section-card:active {
        transform: scale(1.02);
        border-color: #39ff14;
    }
    
    /* Mobile toolbar adjustments */
    .toolbar {
        height: 50px;
        padding: 0.5rem;
    }
    
    .toolbar button {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 40px;
        min-width: 40px;
    }
    
    /* Canvas drop zone visual feedback */
    .canvas-drop-zone {
        border: 2px dashed transparent;
        transition: border-color 0.3s ease;
    }
    
    .canvas-drop-zone.drag-over {
        border-color: #39ff14;
        background-color: rgba(57, 255, 20, 0.05);
    }
}

/* Tablet and Desktop - Restore Original Layout */
@media (min-width: 769px) {
    .landscape-notice {
        display: none !important;
    }
    
    .sidebar {
        width: 320px !important;
        height: 100vh;
        position: static !important;
        transform: none !important;
        background: #161b22 !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }
    
    .sidebar::before {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
        height: auto;
        overflow: visible;
    }
    
    .canvas {
        min-height: auto;
        touch-action: auto;
        padding: 1.5rem;
    }
    
    /* Hide mobile toggle on desktop */
    .sidebar .md\:hidden {
        display: none !important;
    }
    
    /* Reset desktop drag handles */
    .drag-handle {
        padding: 1rem;
        touch-action: auto;
        -webkit-user-select: auto;
        user-select: auto;
        -webkit-touch-callout: auto;
        -webkit-tap-highlight-color: auto;
    }
    
    /* Reset desktop section cards */
    .section-card {
        min-height: auto;
        margin-bottom: 0.75rem;
        border-width: 1px;
    }
    
    .section-card:active {
        transform: none;
        border-color: #30363d;
    }
    
    /* Reset desktop toolbar */
    .toolbar {
        height: auto;
        padding: 1rem;
    }
    
    .toolbar button {
        padding: 0.5rem 1rem;
        font-size: 1rem;
        min-height: auto;
        min-width: auto;
    }
    
    /* Reset canvas drop zone */
    .canvas-drop-zone {
        border: none;
    }
    
    .canvas-drop-zone.drag-over {
        border-color: transparent;
        background-color: transparent;
    }
}

/* Button Hover Effects */
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(57, 255, 20, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
}

/* Modal Animations */
.modal-enter {
    opacity: 0;
    transform: scale(0.9);
}

.modal-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 300ms, transform 300ms;
}

.modal-exit {
    opacity: 1;
    transform: scale(1);
}

.modal-exit-active {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 300ms, transform 300ms;
}

/* Loading Spinner */
.spinner {
    border: 2px solid #30363d;
    border-top: 2px solid #39ff14;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fullscreen Mode */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #0d1117;
}

.fullscreen .preview-content {
    height: 100vh;
    overflow-y: auto;
}

/* Section Card Animations */
.section-card {
    transition: all 0.3s ease;
}

.section-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(57, 255, 20, 0.2);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #161b22;
    border: 1px solid #39ff14;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e6edf3;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Code Editor Styling */
.code-editor {
    font-family: 'Fira Code', 'Monaco', 'Menlo', monospace;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    color: #e6edf3;
    resize: vertical;
    min-height: 200px;
}

.code-editor:focus {
    outline: none;
    border-color: #39ff14;
    box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.2);
}

/* Syntax Highlighting */
.token.comment { color: #7c7c7c; }
.token.string { color: #a5d6ff; }
.token.number { color: #79c0ff; }
.token.boolean { color: #ff7b72; }
.token.keyword { color: #ff7b72; }
.token.function { color: #d2a8ff; }
.token.variable { color: #ffa657; }

/* Print Styles */
@media print {
    .sidebar,
    .toolbar,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        width: 100%;
    }
    
    .preview {
        box-shadow: none;
        border: none;
    }
}