* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    background: #191919 url('Circular_Layered_Crop_Corner_Carbon.png') center/cover no-repeat fixed;
    min-height: 100vh;
    color: #FFFEFA;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: #FFFEFA;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.sidebar {
    width: 350px;
    background: rgba(26, 49, 73, 0.08);
    border: 1px solid #6B665F;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.sidebar-header h2 {
    color: #E8DCC7;
    font-size: 1.3rem;
}

.script-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.script-item {
    padding: 15px;
    border: 1px solid #6B665F;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(246, 241, 231, 0.04);
}

.script-item:hover {
    border-color: #B6C9FF;
    background: rgba(182, 201, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 49, 73, 0.35);
}

.script-item.active {
    border-color: #3F59E4;
    background: rgba(63, 89, 228, 0.12);
    box-shadow: 0 5px 15px rgba(63, 89, 228, 0.35);
}

.script-item h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #FFFEFA;
}

.script-item p {
    font-size: 0.9rem;
    color: #AFABA1;
    margin-bottom: 8px;
}

.script-item .script-meta {
    font-size: 0.8rem;
    color: #AFABA1;
    display: flex;
    justify-content: space-between;
}

.content-area {
    flex: 1;
    background: rgba(25, 25, 25, 0.7);
    border: 1px solid #6B665F;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    overflow: hidden;
}

.tabs {
    display: flex;
    gap: 8px;
    padding: 12px 12px 0 12px;
    border-bottom: 1px solid #6B665F;
    background: rgba(26, 49, 73, 0.08);
}

.tab {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    color: #FFFEFA;
    padding: 12px 18px; /* bigger hit area */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem; /* larger text */
}

.tab:hover {
    background: rgba(182, 201, 255, 0.08);
}

.tab.active {
    border-color: #6B665F;
    border-bottom-color: transparent;
    background: rgba(25,25,25,0.7);
}

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
}

.welcome-content {
    text-align: center;
    max-width: 500px;
}

.welcome-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #FFFEFA;
}

.welcome-content p {
    font-size: 1.1rem;
    color: #AFABA1;
    margin-bottom: 30px;
    line-height: 1.6;
}

.wizard-cta { margin-top: 24px; }

.recording-screen {
    padding: 20px;
}

/* Center the recording wizard content */
#recording-screen .welcome-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

#recording-screen .wizard-steps {
    align-items: stretch;
    text-align: left; /* keep step text readable */
}

.features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(246, 241, 231, 0.04);
    border-radius: 10px;
    border-left: 4px solid #3F59E4;
}

.feature .icon {
    font-size: 1.5rem;
}

.script-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.editor-header {
    padding: 20px;
    border-bottom: 1px solid #6B665F;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 49, 73, 0.08);
}

.script-name-input {
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    background: transparent;
    color: #FFFEFA;
    outline: none;
    min-width: 200px;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.editor-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.script-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.script-meta label {
    font-weight: 600;
    color: #E8DCC7;
}

.script-meta input {
    padding: 10px;
    background: rgba(25,25,25,0.6);
    border: 1px solid #6B665F;
    color: #FFFEFA;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.script-meta input:focus {
    border-color: #3F59E4;
}

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

.code-editor-container label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

#script-code {
    flex: 1;
    padding: 15px;
    background: rgba(25,25,25,0.6);
    border: 1px solid #6B665F;
    color: #FFFEFA;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    resize: none;
    transition: border-color 0.3s ease;
}

#script-code:focus {
    border-color: #3F59E4;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #3F59E4;
    color: #FFFEFA;
}

.btn-primary:hover {
    background: #1A3149;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 49, 73, 0.35);
}

.btn-success {
    background: #6B665F;
    color: #FFFEFA;
}

.btn-success:hover {
    background: #AFABA1;
    color: #191919;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(175, 171, 161, 0.35);
}

.btn-danger {
    background: #6B665F;
    color: #FFFEFA;
}

.btn-danger:hover {
    background: #3F59E4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 89, 228, 0.35);
}

.btn-secondary {
    background: transparent;
    border: 1px solid #6B665F;
    color: #FFFEFA;
}

.btn-secondary:hover {
    background: rgba(182, 201, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(182, 201, 255, 0.25);
}

.hidden {
    display: none !important;
}

/* Recording Wizard - remove default numbering from ordered list */
.wizard-steps {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.wizard-steps .wizard-step {
    list-style: none;
}

/* When recording screen is active, hide the script editor controls */
#recording-screen:not(.hidden) ~ #script-editor {
    display: none !important;
}

/* Keep wizard navigation fixed at the bottom of the recording view */
#recording-screen {
    position: relative;
}

#recording-screen .welcome-content {
    position: relative;
    /* Reserve space so content doesn't go under the sticky nav */
    padding-bottom: 80px;
}

#recording-screen .wizard-nav {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 0;
    background: rgba(25,25,25,0.7);
    border-top: 1px solid #6B665F;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
}

/* Modal (Recording Wizard) */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.modal-content {
    width: 100%;
    max-width: 720px;
    background: rgba(26, 49, 73, 0.12);
    border: 1px solid #6B665F;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    color: #FFFEFA;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #6B665F;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #6B665F;
}

.wizard-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    list-style: decimal inside;
}

.wizard-step h4 {
    margin-bottom: 6px;
}

.wizard-step p {
    color: #AFABA1;
}

.wizard-code {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 8px;
    background: rgba(25,25,25,0.6);
    border: 1px solid #6B665F;
    border-radius: 6px;
}

.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wizard-progress {
    color: #AFABA1;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: 300px;
    }
    
    .content-area {
        height: 500px;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .editor-actions {
        justify-content: center;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(25,25,25,0.5);
    border-radius: 4px;
}

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

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

/* Login Gate */
.login-gate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(25,25,25,0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 28px;
    background: rgba(26, 49, 73, 0.12);
    border: 1px solid #6B665F;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    text-align: center;
}

.login-card h1 {
    color: #FFFEFA;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.login-card p {
    color: #AFABA1;
    margin-bottom: 20px;
}

.login-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.login-help {
    margin-top: 16px;
}

.login-help a {
    color: #B6C9FF;
    text-decoration: none;
}

.login-help a:hover {
    color: #3F59E4;
    text-decoration: underline;
}
