/* Import Poppins Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #F7E6D2;       /* Antique White */
    --accent-color: #90202C;   /* Burgundy */
    --accent-hover: #701520;   /* Darker Burgundy for hover effects */
    --text-color: #2c1e1e;     /* Dark warm gray/brown for text */
    --white: #ffffff;
    --light-border: #e0d0c0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(144, 32, 44, 0.1);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #665555;
    margin-bottom: 30px;
    font-style: italic;
    font-weight: 300;
}

.section {
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid var(--light-border);
    background: #fffbf7;
    border-radius: 6px;
}

.section h2 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Icon specific styling */
i {
    margin-right: 5px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--accent-color);
}

input[type="text"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid var(--light-border);
    background-color: #fff;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    border-radius: 4px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
}

button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    cursor: pointer;
    font-weight: 600;
    border-radius: 4px;
    transition: background 0.3s, transform 0.1s;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

button:hover {
    background: var(--accent-hover);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

#searchResults {
    margin-top: 30px;
}

.results {
    margin-top: 20px;
}

.result-item {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.result-title {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 8px;
}

.result-authors, .result-year, .result-source {
    color: #665555;
    font-size: 0.95em;
    margin-bottom: 5px;
    font-weight: 500;
}

.result-snippet {
    color: #4a4a4a;
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 0.95em;
    margin-top: 5px;
}

.result-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
}

.result-link:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

.citation-output {
    background: #fdf6f0;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #27ae60;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--accent-color);
    font-style: italic;
    font-weight: 500;
}

.error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
}

.success {
    background: #27ae60;
    color: white;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
}

.copy-btn {
    background: #27ae60;
    padding: 8px 20px;
    font-size: 0.9em;
    margin-top: 10px;
}

.copy-btn:hover {
    background: #219150;
}

.info-box {
    background: #f9ecec;
    border-left: 4px solid var(--accent-color);
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #553333;
    display: flex;
    align-items: flex-start;
}

.info-box i {
    margin-top: 3px;
    margin-right: 10px;
    color: var(--accent-color);
}

.extracted-info {
    background: white;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
}

.extracted-info h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.extracted-info p {
    margin: 5px 0;
    color: #444;
}

.extracted-info ul {
    margin-left: 20px;
    color: #444;
}

.extracted-info li {
    margin: 5px 0;
}

/* Tab Styles */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--accent-color);
}

.tab-button {
    background: #e0d0c0;
    color: #554444;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    border-radius: 5px 5px 0 0;
    font-family: 'Poppins', sans-serif;
}

.tab-button:hover {
    background: #d0c0b0;
    color: var(--accent-color);
}

.tab-button.active {
    background: var(--accent-color);
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
    background: white;
    border: 2px solid var(--accent-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.tab-content.active {
    display: block;
}

.results-container {
    min-height: 200px;
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.8em;
    }
    .tabs {
        flex-wrap: wrap;
    }
    .tab-button {
        font-size: 0.9em;
        padding: 10px 15px;
        flex-grow: 1;
    }
}