/* General Body Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

/* Header Styles */
.auth-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.auth-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-container h1 {
    font-size: 1.5rem;
    color: #0079d3;
    font-weight: 700;
    margin: 0;
}

.auth-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #0079d3;
    border-radius: 20px;
    background-color: transparent;
    color: #0079d3;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover,
#login-gate-signup:hover {
    background-color: #0079d3;
    color: #ffffff;
}

#sign-in-btn {
    background-color: #0079d3;
    color: #ffffff;
}

#sign-in-btn:hover {
    background-color: #005fa3;
    border-color: #005fa3;
}

/* Login Gate Styles */
.login-gate {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.login-container {
    background-color: #ffffff;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    text-align: center;
}

.login-content h1 {
    font-size: 2.2rem;
    color: #333;
    margin-bottom: 1rem;
}

.login-content > p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2.5rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    text-align: left;
}

.feature {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.feature h3 {
    font-size: 1.1rem;
    color: #0079d3;
    margin: 0 0 0.5rem 0;
}

.feature p {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

.login-prompt {
    margin-top: 2rem;
}

.primary-btn,
.secondary-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #0079d3;
}

.primary-btn {
    background-color: #0079d3;
    color: #ffffff;
}

.primary-btn:hover {
    background-color: #005fa3;
}

.secondary-btn {
    background-color: transparent;
    color: #0079d3;
}

.secondary-btn:hover {
    background-color: #0079d3;
    color: #ffffff;
}

/* Main Content Styles */
.main-content {
    padding: 2rem;
}

.container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.left-section,
.right-section {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    flex: 1;
}

.left-section {
    flex-basis: 60%;
}

.right-section {
    flex-basis: 40%;
}

h1, h2 {
    color: #0079d3;
    margin-top: 0;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

#interest-form,
#top-posts-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #0079d3;
    box-shadow: 0 0 0 2px rgba(0, 121, 211, 0.2);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 0.5rem 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #555;
}

button[type="submit"] {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 20px;
    background-color: #0079d3;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

button[type="submit"]:hover {
    background-color: #005fa3;
}

/* Results and Posts */
#results-container,
#posts-container {
    margin-top: 2rem;
}

.result-item,
.post-item {
    background-color: #f9f9f9;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.result-item:hover,
.post-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.result-item h3,
.post-item h4 {
    margin: 0;
    color: #333;
}

.result-item h3 a,
.post-item h4 a {
    text-decoration: none;
    color: #0079d3;
    font-weight: 600;
}

.result-item h3 a:hover,
.post-item h4 a:hover {
    text-decoration: underline;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ff4500;
    padding: 0;
}

.result-item p,
.post-item p {
    margin: 0.25rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* Spinner */
#loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

#loading.hidden {
    display: none !important;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #0079d3;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Initial State Control */
#main-content {
    display: none;
}
#main-content.show {
    display: block;
}
#login-gate.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

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

    .auth-header {
        padding: 1rem;
    }

    .auth-container h1 {
        font-size: 1.2rem;
    }

    .login-container {
        padding: 2rem;
    }
}