:root {
    --editor-bg: #f8fafc;
    --editor-border: #e2e8f0;
    --nav-height: 60px;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation Styles */
.top-nav {
    height: var(--nav-height);
    background-color: white;
    border-bottom: 1px solid var(--editor-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: #64748b;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: var(--editor-bg);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: var(--editor-bg);
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    padding: 2rem;
    margin-top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
}

/* Left Panel Styles */
.left-panel {
    background-color: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: 100%;
    position: relative;
    border: 1px solid #e2e8f0;
}

.panel-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Right Panel Styles */
.right-panel {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.editor-container {
    position: absolute;
    top: 60px; /* Height of editor header */
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background-color: white !important;
    border-radius: 8px;
    padding: 20px;
    min-height: 500px;
    color: #333 !important;
}

/* Form Styles */
.blue-gradient-button {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.1);
}

.blue-gradient-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(124, 58, 237, 0.2);
}

.button-icon {
    font-size: 1.2rem;
}

/* Tips Section */
.tips-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.tips-section h3 {
    color: #334155 !important;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.tips-section ul {
    padding-left: 1.5rem;
    color: #64748b !important;
}

.tips-section li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 350px 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        height: auto;
        margin-top: 1rem;
    }
    
    .left-panel, .right-panel {
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .left-panel {
        position: relative;
        padding: 1rem;
    }
    
    .right-panel {
        position: relative;
        margin-top: 1rem;
        height: 500px !important;
    }
    
    .heading-container {
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .heading-container h1 {
        font-size: 1.5rem;
    }
    
    .heading-container h2 {
        font-size: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
        background: transparent;
    }
    
    .form-group label {
        color: #334155 !important;
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    .form-group input,
    .form-group select {
        width: 100%;
        padding: 0.75rem;
        background-color: #ffffff !important;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        color: #1e293b !important;
        font-size: 0.95rem;
        margin-top: 0.25rem;
    }
    
    .form-group input:focus,
    .form-group select:focus {
        border-color: #7c3aed;
        box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
        outline: none;
    }
    
    .form-group input::placeholder {
        color: #94a3b8 !important;
    }
    
    .editor-container {
        position: relative !important;
        top: 0 !important;
        height: 450px !important;
    }
    
    .editor-header {
        padding: 0.75rem;
    }
    
    .editor-header h3 {
        font-size: 1rem;
    }
    
    .editor-actions {
        gap: 0.25rem;
    }
    
    .icon-button {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .tips-section {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .tips-section h3 {
        font-size: 0.9rem;
    }
    
    .tips-section ul {
        font-size: 0.85rem;
    }
    
    .tips-section li {
        margin-bottom: 0.5rem;
    }
    
    .blue-gradient-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .panel-content {
        position: relative !important;
        padding: 1rem;
        overflow: visible;
    }

    .heading-container h1 {
        color: #1e293b !important;
    }

    .heading-container h2.gradient {
        background: linear-gradient(135deg, #7c3aed, #4f46e5);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* Additional fixes for very small screens */
@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .editor-actions {
        flex-wrap: wrap;
    }
    
    .icon-button {
        width: 100%;
        justify-content: center;
    }

    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevent auto-zoom on iOS */
    }

    .panel-content {
        padding: 0.75rem;
    }
}

/* Keep existing styles for form-group, editor, loading, etc. */

.heading-container {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.heading-container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1e293b !important;  /* Dark blue-gray */
    font-weight: 600;
}

.heading-container h2 {
    font-size: 1.1rem;
    color: #64748b !important;  /* Lighter blue-gray */
    font-weight: 400;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #334155 !important;  /* Medium blue-gray */
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #7c3aed;  /* Purple highlight */
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    outline: none;
}

.form-group input::placeholder {
    color: #94a3b8 !important;  /* Subtle gray */
}

.editor-header {
    padding: 1rem;
    border-bottom: 2px solid var(--editor-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--editor-bg);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-button {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s;
    border-radius: 6px;
}

.icon-button:hover {
    background-color: #f1f5f9;
}

.editor {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background-color: var(--editor-bg);
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.loading-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    z-index: 1000;
}

.loading {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.loading span {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: bounce 0.5s alternate infinite;
}

.loading span:nth-child(2) { animation-delay: 0.1s; }
.loading span:nth-child(3) { animation-delay: 0.2s; }

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.research-outline {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.outline-section {
    margin-bottom: 1.5rem;
}

.section-title {
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #7c3aed;
}

.section-content {
    color: #4a5568;
    line-height: 1.6;
    padding: 0.5rem 0;
}

/* Research Topic text */
.research-topic {
    color: #334155 !important;  /* Medium blue-gray */
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Citation Style text */
.citation-style {
    color: #334155 !important;  /* Medium blue-gray */
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Number of Sections text */
.number-sections {
    color: #334155 !important;  /* Medium blue-gray */
    margin-bottom: 0.5rem;
    font-weight: 500;
} 