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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(130deg, rgb(33, 95, 154), rgb(57, 181, 222), rgb(253, 191, 92)) fixed;
    min-height: 100vh;
    color: #333;
}

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

.main-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

main {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
}

header {
    text-align: center;
    color: white;
    padding: 40px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo {
    height: 80px;
    width: auto;
}

.header-text {
    text-align: left;
}

.brand-name {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.95;
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.seo-description {
    font-size: 0.95em;
    opacity: 0.9;
    max-width: 600px;
    line-height: 1.4;
}

main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 40px;
    margin: 20px 0;
}

.upload-section {
    text-align: center;
}

.upload-area {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 60px 40px;
    background: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: rgb(57, 181, 222);
    background: #e8f4f8;
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-area h2 {
    color: #333;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
}

.privacy-notice {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    margin: 15px auto;
    max-width: 500px;
    border: 1px solid #a5d6a7;
}

.btn-primary {
    background: rgb(33, 95, 154);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: rgb(57, 181, 222);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(57, 181, 222, 0.4);
}

#viewCitationsBtn:hover {
    background: #E66A10 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 123, 32, 0.5) !important;
}

.file-info {
    margin-top: 30px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
}

.loading-section {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid rgb(57, 181, 222);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-section {
    animation: fadeIn 0.5s ease;
}

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

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

.results-header h2 {
    font-size: 2em;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.style-selector select {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    margin-left: 10px;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e0e0e0;
    border-color: #999;
}

.quality-score-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.quality-score-card {
    background: white;
    border-radius: 16px;
    padding: 30px 50px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    text-align: center;
    min-width: 300px;
}

.quality-score-card h3 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.score-circle {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.score-value {
    font-size: 4.5em;
    font-weight: 700;
    line-height: 1;
}

.score-unit {
    font-size: 2em;
    font-weight: 600;
    opacity: 0.7;
}

.score-description {
    font-size: 1.05em;
    color: #666;
    margin: 0;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.card {
    background: linear-gradient(135deg, rgb(33, 95, 154), rgb(57, 181, 222));
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.card h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    opacity: 0.9;
}

.card-stat {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
}

.stat-label {
    font-size: 1.1em;
    opacity: 0.8;
}

.stat-breakdown {
    margin-top: 10px;
    font-size: 0.95em;
}

.stat-issues {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.results-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    align-items: center;
}

.tab-controls {
    margin-left: auto;
    padding-right: 10px;
}

.sort-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.sort-toggle input[type="checkbox"] {
    cursor: pointer;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: rgb(33, 95, 154);
}

.tab-btn.active {
    color: rgb(33, 95, 154);
    border-bottom-color: rgb(57, 181, 222);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.citation-item, .reference-item {
    background: white;
    border: 1px solid #eee;
    border-left: 4px solid rgb(57, 181, 222);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.citation-item.has-issues, .reference-item.has-issues {
    border-left-color: #ff6b6b;
}

.citation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.citation-number {
    background: rgb(33, 95, 154);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.citation-type {
    font-size: 0.85em;
    color: #666;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 12px;
}

.citation-text {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
}

.issue-list {
    margin-top: 15px;
}

.issue-item {
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: 6px;
    font-size: 0.95em;
}

.issue-item.error {
    background: #ffe0e0;
    border-left: 3px solid #ff6b6b;
}

.issue-item.warning {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
}

.issue-item.success {
    background: #d4edda;
    border-left: 3px solid #28a745;
}

.issue-label {
    font-weight: 600;
    margin-right: 8px;
}

.issue-label.error {
    color: #d63031;
}

.issue-label.warning {
    color: #f39c12;
}

.issue-label.success {
    color: #27ae60;
}

.reference-entry {
    font-size: 0.95em;
    line-height: 1.8;
    color: #333;
}

.reference-entry .author {
    font-weight: 600;
}

.reference-entry .year {
    font-weight: 600;
}

.info-icon {
    cursor: help;
    margin-left: 5px;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-icon:hover {
    opacity: 1;
}

.highlight-mismatch {
    background: #ffebee;
    padding: 2px 4px;
    border-radius: 3px;
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
    opacity: 0.8;
}

/* Disclaimer Modal */
.disclaimer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.disclaimer-modal-content {
    background: #fff9e6;
    border: 3px solid #f39c12;
    border-radius: 12px;
    padding: 40px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.disclaimer-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2em;
    color: #e67e22;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.disclaimer-close:hover {
    background: rgba(230, 126, 34, 0.1);
    transform: scale(1.1);
}

.disclaimer-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.disclaimer-modal-content h2 {
    color: #e67e22;
    margin-bottom: 25px;
    font-size: 2em;
}

.disclaimer-text {
    text-align: left;
    margin-bottom: 30px;
    font-size: 1.05em;
    line-height: 1.6;
}

.disclaimer-text p {
    margin-bottom: 15px;
    color: #555;
}

.disclaimer-text ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.disclaimer-text li {
    margin-bottom: 10px;
    color: #555;
}

.disclaimer-text strong {
    color: #333;
}

.btn-large {
    font-size: 1.1em;
    padding: 15px 40px;
    margin-top: 10px;
}

/* Privacy Policy Modal */
.privacy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.privacy-modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.privacy-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2em;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.privacy-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
    color: #333;
}

.privacy-modal-content h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2em;
    text-align: center;
}

.privacy-modal-content h3 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.privacy-text {
    text-align: left;
    font-size: 1em;
    line-height: 1.7;
    color: #555;
}

.privacy-text p {
    margin-bottom: 15px;
}

.privacy-text ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.privacy-text li {
    margin-bottom: 10px;
}

.privacy-text strong {
    color: #333;
    font-weight: 600;
}

.privacy-link {
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
}

.privacy-link:hover {
    text-decoration: underline;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
}

.sidebar-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.sidebar-newsletter {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.newsletter-header {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    padding: 20px;
    text-align: center;
}

.newsletter-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.newsletter-header p {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.95;
}

.newsletter-form {
    padding: 20px;
}

.newsletter-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.newsletter-input:focus {
    outline: none;
    border-color: #2196f3;
}

.newsletter-btn {
    width: 100%;
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.newsletter-gdpr {
    margin: 10px 0 0 0;
    font-size: 0.75em;
    color: #999;
    text-align: center;
    line-height: 1.4;
}

.sidebar-header {
    background: linear-gradient(135deg, rgb(33, 95, 154), rgb(57, 181, 222));
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
}

.sidebar-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.sidebar-subtitle {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    opacity: 0.95;
    font-weight: 400;
}

.sidebar-source {
    margin: 0;
    font-size: 0.75em;
    opacity: 0.8;
    font-style: italic;
}

.sidebar-posts {
    padding: 15px;
}

.sidebar-loading {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-style: italic;
}

.sidebar-post {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    transition: transform 0.2s ease;
}

.sidebar-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-post:hover {
    transform: translateX(5px);
}

.sidebar-post a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sidebar-post-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.sidebar-post-title {
    font-size: 1em;
    font-weight: 600;
    color: rgb(33, 95, 154);
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.sidebar-post-date {
    font-size: 0.85em;
    color: #999;
    display: block;
    margin-top: 5px;
}

.sidebar-error {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .main-content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        height: 60px;
    }

    .header-text {
        text-align: center;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Custom yellow tooltip for ordering warnings */
.ordering-warning-tooltip {
    position: absolute;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 350px;
    font-size: 14px;
    line-height: 1.5;
    color: #856404;
    display: none;
    pointer-events: none;
}

/* DOI Check Styles */
.doi-check-container {
    padding: 20px 0;
}

.doi-check-header {
    margin-bottom: 30px;
}

.doi-check-header h3 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 10px;
}

.doi-check-settings {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.email-input-group {
    margin-bottom: 15px;
}

.email-input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 1em;
}

.doi-check-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.doi-check-input:focus {
    outline: none;
    border-color: rgb(57, 181, 222);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgb(33, 95, 154), rgb(57, 181, 222));
    transition: width 0.3s ease;
    width: 0%;
}

.doi-results-summary {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.doi-results-summary h3 {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    color: #333;
}

.summary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.metric {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.metric.success {
    border-left: 4px solid #28a745;
}

.metric.warning {
    border-left: 4px solid #ffc107;
}

.metric.error {
    border-left: 4px solid #dc3545;
}

.metric.info {
    border-left: 4px solid #17a2b8;
}

.metric-number {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.metric.success .metric-number {
    color: #28a745;
}

.metric.warning .metric-number {
    color: #ffc107;
}

.metric.error .metric-number {
    color: #dc3545;
}

.metric.info .metric-number {
    color: #17a2b8;
}

.metric-label {
    display: block;
    font-size: 1em;
    color: #666;
}

.doi-results-filter {
    display: flex;
    gap: 25px;
}

.doi-result-item {
    background: white;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.doi-result-item.success {
    border-left: 5px solid #28a745;
}

.doi-result-item.warning {
    border-left: 5px solid #ffc107;
}

.doi-result-item.error {
    border-left: 5px solid #dc3545;
}

.doi-result-item.no-doi {
    border-left: 5px solid #17a2b8;
}

.doi-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.doi-result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.doi-result-number {
    background: rgb(33, 95, 154);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1em;
}

.doi-result-status {
    font-weight: 600;
    font-size: 1.1em;
    flex: 1;
}

.doi-result-status.success {
    color: #28a745;
}

.doi-result-status.warning {
    color: #f39c12;
}

.doi-result-status.error {
    color: #dc3545;
}

.doi-result-status.no-doi {
    color: #17a2b8;
}

.doi-result-score {
    background: #f0f0f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
}

.doi-result-original {
    margin-bottom: 15px;
}

.doi-result-detail {
    margin-bottom: 12px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.doi-result-detail.highlight {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
}

.doi-result-detail code {
    background: #e0e0e0;
    padding: 3px 8px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

.doi-result-recommendation {
    margin-top: 15px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 4px;
    border-left: 3px solid #2196f3;
}
