* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* App takes whole screen */
    height: 100vh;
}

#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

#sidebar {
    width: 300px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 15px;
    background: var(--header-bg);
    color: var(--header-text);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

#composition-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex-grow: 1;
}

#composition-list li {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s;
}

#composition-list li:hover {
    background: var(--hover-bg);
}

#workspace {
    flex-grow: 1;
    position: relative;
    overflow: hidden; /* For dragging boundaries */
}

/* Auth Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--panel-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.modal-content input {
    padding: 10px;
    margin: 10px 0;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
}

.modal-content button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--btn-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.error-text {
    color: #e74c3c;
    margin-top: 10px;
    min-height: 20px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    #sidebar {
        width: 100%;
    }
    
    .mobile-hide-sidebar #sidebar {
        display: none;
    }
}

/* Prevent iframe from intercepting mouse events during drag */
body.is-dragging iframe {
    pointer-events: none;
}

