/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* App Container */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

/* Scene List */
.scene-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scene-item {
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scene-item:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.scene-item.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.scene-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.scene-item-meta {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Item Lists */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item {
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-name {
    font-weight: 500;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
}

.item-action {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 2px;
    font-size: 0.8rem;
}

.item-action:hover {
    background: #e9ecef;
    color: #495057;
}

.item-action.delete:hover {
    color: #dc3545;
}

/* Scene Editor */
.scene-editor {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
}

#editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.welcome-screen h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.welcome-screen p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Scene Editor Content */
.scene-editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.scene-header {
    margin-bottom: 1.5rem;
}

.scene-title-input {
    width: 100%;
    font-size: 1.5rem;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    background: transparent;
    color: #2c3e50;
}

.scene-title-input:focus {
    outline: none;
    border-bottom-color: #3498db;
}

.scene-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.scene-select,
.scene-input {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.scene-select:focus,
.scene-input:focus {
    outline: none;
    border-color: #3498db;
}

/* Scene Content */
.scene-content {
    flex: 1;
    margin-bottom: 1.5rem;
}

.scene-textarea {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    resize: none;
}

.scene-textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Scene Actions */
.scene-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.close:hover {
    color: #495057;
}

.modal-body {
    padding: 1.5rem;
}

.modal-input,
.modal-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.modal-textarea {
    height: 100px;
    resize: vertical;
}

.modal-input:focus,
.modal-textarea:focus {
    outline: none;
    border-color: #3498db;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .scene-meta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}