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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background: #f4f6f8;
    color: #333;
    min-height: 100vh;
}

/* Header Styles */
header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.version {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Main Content Styles */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    padding-bottom: 4rem;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

/* Form Styles */
form {
    max-width: 800px;
    margin: 2rem auto;
}

.input-group {
    display: flex;
    gap: 1rem;
}

input[type="text"] {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: #3498db;
    outline: none;
}

button {
    padding: 1rem 2rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button:hover {
    background: #34495e;
    transform: translateY(-1px);
}

/* Status & Loading Styles */
#api-status {
    text-align: center;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.status-checking {
    background: #fff3cd;
    color: #856404;
}

.status-connected {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.hidden {
    display: none !important;
}

#loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.sub-text {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Result Styles */
#result {
    margin-top: 2rem;
}

#article-content {
    line-height: 1.8;
    font-size: 16px;
}

#article-content h1 {
    color: #2c3e50;
    font-size: 2em;
    margin: 1em 0 0.5em;
    text-align: left;
}

#article-content h2 {
    color: #34495e;
    font-size: 1.5em;
    margin: 1em 0 0.5em;
}

#article-content h3 {
    color: #445566;
    font-size: 1.2em;
    margin: 1em 0 0.5em;
}

#article-content p {
    margin-bottom: 1em;
    text-align: justify;
}

#article-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid #3498db;
    transition: all 0.3s;
}

#article-content a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

#article-content ul, #article-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

#article-content li {
    margin-bottom: 0.5em;
}

/* Copy Button Styles */
.copy-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    width: auto;
}

.copy-button:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.copy-button.success {
    background: #27ae60;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #27ae60;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 90;
}

/* Responsive Design */
@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
    
    .copy-button {
        bottom: 5rem;
    }
    /* Article Content Styles */
.article-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

#article-content {
    line-height: 1.8;
    font-size: 16px;
}

#article-content h1 {
    font-size: 2em;
    color: #2c3e50;
    margin: 1em 0 0.5em;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5em;
}

#article-content h2 {
    font-size: 1.5em;
    color: #34495e;
    margin: 1em 0 0.5em;
}

#article-content h3 {
    font-size: 1.2em;
    color: #445566;
    margin: 1em 0 0.5em;
}

#article-content p {
    margin-bottom: 1em;
    text-align: justify;
}

#article-content strong {
    font-weight: bold;
    color: #2c3e50;
}

#article-content em {
    font-style: italic;
    color: #34495e;
}

#article-content ul, #article-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

#article-content li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

#article-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid #3498db;
    transition: all 0.3s ease;
}

#article-content a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

/* List Styles */
#article-content ul {
    list-style-type: disc;
}

#article-content ol {
    list-style-type: decimal;
}

/* Blockquote Styles */
#article-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 1em;
    margin: 1em 0;
    color: #666;
    font-style: italic;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #27ae60;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-align: center;
    min-width: 200px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.toast.error {
    background: #e74c3c;
}

 .meta-box {
            margin: 10px 0;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            background: #f9f9f9;
        }
        .meta-box strong {
            font-weight: bold;
        }

}

/* Auth Buttons */
.auth-buttons {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: white;
    color: #2c3e50;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.modal input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* User Menu */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgb(34, 34, 34);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    min-width: 150px;
}

.user-menu.active .user-menu-content {
    display: block;
}

.user-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: #333;
}

.user-menu-item:hover {
    background: #f5f5f5;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.8rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.auth-submit-btn:hover {
    background: #34495e;
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Navigation Styles */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#loginBtn {
    background: transparent;
    border: 1px solid #2c3e50;
    color: #2c3e50;
}

#loginBtn:hover {
    background: #2c3e50;
    color: white;
}

#signupBtn {
    background: #2c3e50;
    border: 1px solid #2c3e50;
    color: white;
}

#signupBtn:hover {
    background: #34495e;
    border-color: #34495e;
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #2c3e50;
    color: #2c3e50;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.user-menu-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 0.5rem;
    min-width: 150px;
}

.user-menu.active .user-menu-content {
    display: block;
}

.user-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.user-menu-item:hover {
    background: #f5f5f5;
}

/* Adjust main content to account for fixed header */
main {
    padding-top: 80px; /* Adjust this value based on your navbar height */
}

/* Modal Styles - adjust z-index */
.modal {
    z-index: 1001; /* Should be higher than navbar */
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }

    .auth-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .logo {
        font-size: 1.2rem;
    }
}
