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

/* Focus styles */
button:focus,
a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 10px;
    background: #2c3e50;
    color: white;
    padding: 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    z-index: 1000;
}

.skip-link:focus {
    top: 10px;
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ccc;
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
}

header .subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
}

header .legal-notice {
    font-size: 0.9rem;
    color: #95a5a6;
    margin-top: 1rem;
}

header a {
    color: #3498db;
    text-decoration: none;
}

header a:hover {
    text-decoration: underline;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.sidebar {
    flex: 1;
    min-width: 300px;
}

.viewer-panel {
    flex: 2;
    min-width: 500px;
}

.metadata, .annotations {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.metadata h2, .annotations h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.metadata p {
    margin-bottom: 0.5rem;
}

#annotation-list {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    min-height: 100px;
}

.annotation-item {
    padding: 0.8rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0.5rem;
}

.annotation-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.annotation-item strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.3rem;
}

#clear-annotations-btn {
    display: block;
    margin: 1rem auto 0 auto;
    padding: 0.5rem 1rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    text-align: center;
}

#clear-annotations-btn:hover,
#clear-annotations-btn:focus {
    background: #c0392b;
    outline: 2px solid #c0392b;
    outline-offset: 2px;
}

#add-annotation textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
}

#add-annotation button {
    margin-top: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

#add-annotation button:hover,
#add-annotation button:focus {
    background: #2980b9;
    outline: 2px solid #2980b9;
    outline-offset: 2px;
}



.integration {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.integration h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #ccc;
    color: #7f8c8d;
    font-size: 0.9rem;
}

footer a {
    color: #3498db;
}

/* Navigation */
nav {
    background: #2c3e50;
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

nav li {
    margin: 0;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

nav a:hover,
nav a:focus {
    background: #3498db;
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

nav a.active {
    background: #3498db;
}

.viewer-note {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
    text-align: center;
}

/* Scholarly notes */
.scholarly-notes {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.scholarly-notes h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.note-content h3 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.note-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.note-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.note-content strong {
    color: #2c3e50;
}

/* Responsive */
@media (max-width: 1100px) {
    .container {
        flex-direction: column;
    }
    .sidebar, .viewer-panel {
        min-width: 100%;
    }
    
    nav ul {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    nav a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}