/* css/styles.css - MyPrompt3D Styles */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

/* === LOADER === */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s ease;
}

.loader-content {
    text-align: center;
}

.loader h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #6ee7ff;
    font-weight: 300;
}

.progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #6ee7ff;
    transition: width 0.3s ease;
}

/* === WELCOME SCREEN === */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

.welcome-content {
    text-align: center;
    z-index: 10;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-name {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.tagline {
    font-size: 18px;
    color: #6ee7ff;
    margin-bottom: 40px;
    font-weight: 300;
}

.welcome-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.welcome-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* Grid background */
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(110, 231, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 231, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
}

/* === VIEWPORT === */
.viewport-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#canvas {
    width: 100%;
    height: 100%;
}

.controls-hint {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(110, 231, 255, 0.2);
}

/* === EDITOR BUTTON === */
.editor-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(110, 231, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 50;
}

.editor-button:hover {
    background: #fff;
    transform: scale(1.1);
}

.editor-button svg {
    width: 24px;
    height: 24px;
}

/* === EDITOR PANEL === */
.editor-panel {
    position: fixed;
    top: 0;
    right: -42%;
    width: 40%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    transition: right 0.3s ease;
    overflow-y: auto;
    border-left: 1px solid rgba(110, 231, 255, 0.2);
    z-index: 100;
}

.editor-panel.active {
    right: 0;
}

/* Panel Header */
.panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(110, 231, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 24px;
    font-weight: 300;
}

.close-panel {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-panel:hover {
    transform: rotate(90deg);
}

/* Tabs */
.panel-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(110, 231, 255, 0.2);
}

.tab {
    flex: 1;
    padding: 15px 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
}

.tab.active {
    color: #6ee7ff;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #6ee7ff;
}

.tab:hover {
    color: #fff;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.tab-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 400;
}

.section-hint {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

/* Code Input */
.code-input {
    width: 100%;
    min-height: 300px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(110, 231, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    color: #fff;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    margin-bottom: 20px;
}

.code-input:focus {
    outline: none;
    border-color: rgba(110, 231, 255, 0.5);
}

/* Textarea wrapper for copy/paste buttons */
.textarea-wrapper {
    position: relative;
    width: 100%;
}

.textarea-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.textarea-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #6ee7ff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.textarea-wrapper:hover .textarea-btn {
    opacity: 1;
}

.textarea-btn:hover {
    background: rgba(110, 231, 255, 0.2);
    transform: translateY(-1px);
}

.textarea-btn:active {
    transform: translateY(0);
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    background: #6ee7ff;
    color: #000;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
}

.btn span {
    font-size: 14px;
}

.btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 231, 255, 0.3);
}

/* Keep primary style for consistency */
.btn-primary {
    background: #6ee7ff;
    color: #000;
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 231, 255, 0.3);
}

/* Secondary buttons now look like primary */
.btn-secondary {
    background: #6ee7ff;
    color: #000;
}

.btn-secondary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 231, 255, 0.3);
}

/* Danger button stays slightly different for warning */
.btn-danger {
    background: #6ee7ff;
    color: #000;
}

.btn-danger:hover {
    background: #ff3b30;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 59, 48, 0.3);
}

.file-label {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
}

/* Small icon buttons in object list */
.icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: #6ee7ff;
    color: #000;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.icon-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(110, 231, 255, 0.3);
}

/* Objects List */
.objects-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.objects-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* New object item styles */
.object-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(110, 231, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.object-item.collapsed {
    max-height: 50px;
}

.object-item.expanded {
    max-height: 400px;
}

.object-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    user-select: none;
}

.expand-btn {
    background: none;
    border: none;
    color: #6ee7ff;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.object-item.expanded .expand-btn {
    transform: rotate(0deg);
}

.object-name {
    flex: 1;
    font-size: 14px;
    color: #6ee7ff;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.object-name[contenteditable]:hover {
    background: rgba(110, 231, 255, 0.1);
}

.object-name[contenteditable]:focus {
    background: rgba(110, 231, 255, 0.2);
    outline: none;
}

.object-title {
    font-size: 14px;
    color: #6ee7ff;
}

.object-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.object-content {
    padding: 0 15px 15px 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.object-item.expanded .object-content {
    max-height: 350px;
    padding: 15px;
}

.object-code {
    min-height: 200px;
    transition: opacity 0.3s ease;
    margin-bottom: 0;
}

.object-item.collapsed .object-code {
    opacity: 0;
}

.object-item.expanded .object-code {
    opacity: 1;
}

/* Add object button */
.add-object-container {
    margin-top: 15px;
}

.add-object-btn {
    width: 100%;
    justify-content: center;
}

/* Icon button styles - keep consistent */
.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.icon-btn-danger {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.icon-btn-danger:hover {
    background: rgba(255, 59, 48, 0.3);
}

.object-code {
    min-height: 100px;
}

/* Console Output */
.console-output {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(110, 231, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    margin-bottom: 15px;
}

.console-welcome {
    color: rgba(255, 255, 255, 0.5);
}

.console-log {
    padding: 2px 0;
}

.console-error {
    color: #ff3b30;
}

.console-warn {
    color: #ffcc00;
}

.console-info {
    color: #6ee7ff;
}

/* Best Practices & About */
.practices-content h4,
.about-content h4 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #6ee7ff;
}

.practices-content ul,
.about-content ul {
    list-style: none;
    padding-left: 0;
}

.practices-content li,
.about-content li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.practices-content li:before,
.about-content li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #6ee7ff;
}

.author-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(110, 231, 255, 0.2);
}

.author-info a {
    color: #6ee7ff;
    text-decoration: none;
}

.author-info a:hover {
    text-decoration: underline;
}

.version {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 10px;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(110, 231, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(110, 231, 255, 0.5);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .editor-panel {
        width: 60%;
        right: -65%;
    }
    
    .app-name {
        font-size: 36px;
    }
    
    .tagline {
        font-size: 16px;
    }
    
    .welcome-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .panel-tabs {
        overflow-x: auto;
    }
    
    .tab {
        font-size: 12px;
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .editor-panel {
        width: 85%;
        right: -90%;
    }
    
    .controls-hint {
        font-size: 11px;
        padding: 8px 15px;
    }
}
