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

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #2c3e50;
    --accent: #e74c3c;
    --background: #f8f9fa;
    --white: #ffffff;
    --gray-light: #ecf0f1;
    --gray: #95a5a6;
    --gray-dark: #7f8c8d;
    --text: #2c3e50;
    --text-light: #555;
    --success: #27ae60;
    --warning: #f39c12;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Navbar --- */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--secondary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--primary);
}

.spotify-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1DB954 !important;
    font-weight: 500;
}

.spotify-link:hover {
    color: #1ed760 !important;
    text-decoration: none;
}

.btn-signup {
    background: var(--primary) !important;
    color: var(--white) !important;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
}

.btn-signup:hover {
    background: var(--primary-dark) !important;
    text-decoration: none !important;
}

/* --- Hero --- */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a252f 100%);
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.hero .tagline {
    font-size: 1.5em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.hero .subtitle {
    font-size: 1.1em;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Try It Section --- */
.try-it {
    background: var(--white);
    padding: 60px 20px;
    margin-top: -30px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.try-it h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--secondary);
}

.try-description {
    text-align: center;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 30px;
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
    background: var(--background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.search-box textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.search-box textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.search-controls {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    align-items: stretch;
}

.search-filters {
    display: flex;
    gap: 10px;
    flex: 1;
}

.search-controls select {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 0.95em;
    background: var(--white);
    cursor: pointer;
    min-width: 0;
}

.search-hint {
    text-align: center;
    font-size: 0.85em;
    color: var(--gray-dark);
    margin-top: 12px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

/* --- Results --- */
.results-container {
    max-width: 800px;
    margin: 40px auto 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.results-header h3 {
    color: var(--secondary);
}

#results-count {
    color: var(--gray-dark);
    font-size: 0.9em;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.paper-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.paper-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.paper-rank {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--gray);
    min-width: 40px;
}

.paper-content {
    flex: 1;
}

.paper-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--secondary);
    line-height: 1.4;
    display: block;
    margin-bottom: 8px;
}

.paper-title:hover {
    color: var(--primary);
}

.paper-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.paper-journal {
    color: var(--gray-dark);
    font-weight: 500;
}

.paper-similarity {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.paper-similarity.high {
    background: #d4edda;
    color: #155724;
}

.paper-similarity.medium {
    background: #fff3cd;
    color: #856404;
}

.paper-similarity.low {
    background: var(--gray-light);
    color: var(--gray-dark);
}

.paper-summary {
    color: var(--text-light);
    font-size: 0.9em;
    line-height: 1.5;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-light);
}

.paper-date {
    color: var(--gray);
    font-size: 0.85em;
}

.abstract-toggle {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px 0;
    margin-top: 8px;
    display: block;
}

.abstract-toggle:hover {
    text-decoration: underline;
}

.paper-abstract {
    background: var(--background);
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.6;
    color: var(--text-light);
    border-left: 3px solid var(--primary);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--gray-dark);
}

/* --- Share Section --- */
.share-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.share-prompt {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.share-btn:hover {
    transform: scale(1.05);
    text-decoration: none;
    opacity: 0.9;
}

.share-email {
    background: var(--white);
    color: var(--secondary);
}

.share-twitter {
    background: #1DA1F2;
    color: white;
}

.share-linkedin {
    background: #0077B5;
    color: white;
}

.share-copy {
    background: var(--gray-light);
    color: var(--secondary);
}

/* --- How It Works --- */
.how-it-works {
    padding: 80px 20px;
    background: var(--background);
}

.how-it-works h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 50px;
    color: var(--secondary);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 30px;
}

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h3 {
    margin-bottom: 10px;
    color: var(--secondary);
}

.step p {
    color: var(--text-light);
}

/* --- Features --- */
.features {
    padding: 80px 20px;
    background: var(--white);
}

.features h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 50px;
    color: var(--secondary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    padding: 30px 20px;
    background: var(--background);
    border-radius: 12px;
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.feature h3 {
    margin-bottom: 10px;
    color: var(--secondary);
}

.feature p {
    color: var(--text-light);
    font-size: 0.95em;
}

/* --- Data Privacy --- */
.data-privacy {
    padding: 80px 20px;
    background: var(--background);
}

.data-privacy h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 40px;
    color: var(--secondary);
}

.privacy-highlights {
    max-width: 700px;
    margin: 0 auto 30px;
}

.privacy-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-light);
}

.privacy-item:last-child {
    border-bottom: none;
}

.privacy-item .check {
    color: var(--success);
    font-size: 1.3em;
    font-weight: bold;
}

.privacy-item p {
    color: var(--text-light);
}

.privacy-link {
    display: block;
    text-align: center;
    font-weight: 600;
}

/* --- CTA --- */
.cta {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
}

.cta h2 {
    font-size: 2.2em;
    margin-bottom: 15px;
}

.cta p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 30px;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2em;
    background: var(--white);
    color: var(--primary);
}

.btn-large:hover {
    background: var(--gray-light);
}

.cta-note {
    margin-top: 15px;
    font-size: 0.9em;
    opacity: 0.8;
}

/* --- Footer --- */
.footer {
    background: var(--secondary);
    color: var(--white);
    padding: 50px 20px 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto 30px;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-brand {
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    font-size: 1.3em;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-info {
    text-align: right;
}

.footer-info p {
    opacity: 0.8;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.footer-info a {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9em;
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.5em;
    }

    .hero .tagline {
        font-size: 1.2em;
    }

    .search-controls {
        flex-direction: column;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-info {
        text-align: center;
    }

    .nav-links {
        gap: 15px;
    }

    .paper-item {
        flex-direction: column;
    }

    .paper-rank {
        font-size: 0.9em;
    }
}
