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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Academic Header */
.academic-header {
    background: #1a365d;
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.academic-header h1 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.metadata {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 1rem;
    padding: 1rem;
    flex: 1;
    min-height: 0;
}

/* Left Panel - Controls */
.left-panel {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.control-section h3 {
    color: #1a365d;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-size: 0.9rem;
}

.control-group select,
.control-group input[type="range"],
.control-group input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    padding: 0;
    height: 2rem;
}

.complex-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.control-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.randomize-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.randomize-btn:hover {
    transform: translateY(-2px);
}

/* Center Panel - 3D Scene */
.center-panel {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

#scene-container {
    width: 100%;
    height: 500px;
    position: relative;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 54, 93, 0.9);
    color: white;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-style: italic;
    z-index: 10;
    display: none;
}

/* Right Panel - Paper Content */
.right-panel {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    overflow-y: auto;
    max-height: 500px;
}

.paper-content h3 {
    color: #1a365d;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.paper-content h4 {
    color: #2d3748;
    font-size: 1rem;
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.abstract p {
    text-align: justify;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.equation {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.results-section ul {
    list-style: none;
    padding: 0;
}

.results-section li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.results-section li:last-child {
    border-bottom: none;
}

.results-section span {
    font-weight: 600;
    color: #1a365d;
}

.references {
    margin-top: 1rem;
}

.reference-list {
    font-size: 0.8rem;
}

.reference {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    text-indent: -1rem;
    color: #4a5568;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.export-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-controls button {
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.export-controls button:hover {
    background: #f7fafc;
    transform: translateY(-1px);
}

.submit-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%) !important;
}

.attribution {
    font-size: 0.8rem;
    color: #718096;
}

.attribution a {
    color: #4299e1;
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 200px 1fr 250px;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .left-panel,
    .right-panel {
        max-height: none;
    }
    
    #scene-container {
        height: 400px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0;
    }
    
    .main-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .academic-header {
        padding: 1rem;
    }
    
    .academic-header h1 {
        font-size: 1.4rem;
    }
    
    .footer {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .export-controls {
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.paper-content > * {
    animation: fadeIn 0.5s ease-out;
}

/* Custom scrollbar for paper content */
.right-panel::-webkit-scrollbar {
    width: 6px;
}

.right-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.right-panel::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}