/* start of template styles */
/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: sans-serif;
    background-color: #121212;
    color: #eee;
    line-height: 1.6;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "main"
        "footer";
}

/* Top Navigation Bar */
.top-bar {
    background-color: #1a1a1a;
    padding: 6.5px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    grid-area: header;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links li a {
    text-decoration: none;
    color: #eee;
    font-weight: bold;
}

.nav-links li a:hover,
.nav-links li a.active-link {
    color: #4bc0c0;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-right {
    display: flex;
    align-items: center;
}

.user-account {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-account button {
    padding: 8px 12px;
    background-color: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.user-account button:hover {
    background-color: #444;
}

main {
    grid-area: main;
}


/* MODAL STYLES */
.modal,
.auth-modal,
.sync-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal-content,
.auth-modal-content,
.sync-modal-content {
    background-color: #222;
    color: #eee;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #444;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content h2,
.auth-modal-content h2,
.sync-modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #4bc0c0;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.input-group label {
    margin-bottom: 5px;
    color: #ccc;
    font-size: 0.9em;
}

select,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 10px;
    background-color: #2a2a2a;
    color: white;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

/* Ensure modal buttons have consistent styling */
.auth-modal-content button,
.sync-modal-content button,
.modal-content button {
    padding: 10px 18px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background-color: #007bff;
    margin-right: 5px;
    /* Add some spacing between buttons */
}

.auth-modal-content button:hover,
.sync-modal-content button:hover,
.modal-content button:hover {
    background-color: #0056b3;
}

.auth-modal-content button[type="submit"],
.sync-modal-content button[type="submit"],
.modal-content button[type="submit"] {
    background-color: #007bff;
}

.auth-modal-content button[type="submit"]:hover,
.sync-modal-content button[type="submit"]:hover,
.modal-content button[type="submit"]:hover {
    background-color: #0056b3;
}


.close-modal,
.close-auth-modal,
.close-sync-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover,
.close-auth-modal:hover,
.close-sync-modal:hover {
    color: #fff;
}

.close-modal-button,
.close-auth-modal-button,
.close-sync-modal-button {
    background-color: #6c757d;
}

.close-modal-button:hover,
.close-auth-modal-button:hover,
.close-sync-modal-button:hover {
    background-color: #545b62;
}

.error-message {
    margin-top: 10px;
    min-height: 1em;
    font-size: 0.9em;
    color: #ff6b6b;
    font-weight: bold;
}

#changePasswordSuccess {
    color: #48dbfb !important;
}

/* Sync Specific Styles */
#settingsButton,
#localSyncButton {
    margin-left: 10px;
    background-color: #6c757d;
}

#settingsButton:hover,
#localSyncButton:hover {
    background-color: #545b62;
}

.btn-sync {
    background-color: #28a745 !important;
}

.btn-sync:hover {
    background-color: #1e7e34 !important;
}

#syncStatus {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

#syncStatus.sync-status-success {
    background-color: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #28a745;
}

#syncStatus.sync-status-error {
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #dc3545;
}

/* Sync Choice Modal */
.sync-choice-modal .modal-content {
    max-width: 700px;
}

.comparison-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 20px 0;
}

.data-column {
    flex: 1;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    background-color: #2a2a2a;
}

.data-column h3 {
    margin-top: 0;
    color: #4bc0c0;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.data-column p {
    margin: 8px 0;
    font-size: 0.9em;
    word-wrap: break-word;
}

.data-column p strong {
    color: #ccc;
}

.sync-choice-actions {
    text-align: center;
    margin-top: 25px;
}

.sync-choice-actions button {
    margin: 5px;
}

.btn-upload {
    background-color: #5cb85c;
}

.btn-download {
    background-color: #337ab7;
}


/* Footer */
footer {
    text-align: center;
    padding: 20px;
    ;
    font-size: 0.9rem;
    color: #888;
    grid-area: footer;
}

footer a {
    color: #4bc0c0;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* end of template styles */

/* Custom styles based on user-provided CSS for accurate preview */
.preview-body {
    font-family: Verdana, Helvetica, Arial, sans-serif;
    color: #CCCCCC;
    background-color: #070707;
    font-size: 10px;
    /* Base font size */
    padding: 15px;
    border: 1px solid #121212;
    border-radius: 0.5rem;
}

.preview-body .postbody {
    font-size: 1.3em;
    line-height: 1.4em;
    font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
    color: #BBBBBB;
}

.preview-body a.postlink {
    text-decoration: underline;
    color: #AAAAAA;
}

.preview-body a.postlink:hover {
    color: #FFFFFF;
}

.preview-body br {
    display: block;
    margin-bottom: 0.75em;
    content: "";
}

/* General App Styles */
body {
    /* The font-family is set in the template styles section above.
       This rule just overrides the background and color for the new page. */
    background-color: #111827;
    color: #d1d5db;
}

/* We apply the 'Inter' font only to the main app container,
   so the header is not affected and matches the template. */
#app {
    font-family: 'Inter', sans-serif;
}


.tab-button {
    transition: all 0.3s ease;
}

.tab-button.active {
    background-color: #3b82f6;
    color: white;
}

.file-drop-zone {
    border: 2px dashed #4b5563;
    transition: all 0.3s ease;
}

.file-drop-zone.dragover {
    border-color: #3b82f6;
    background-color: #1f2937;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* NEW: Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    /* Tailwind gray-600 */
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #3b82f6;
    /* Tailwind blue-500 */
}

input:focus+.slider {
    box-shadow: 0 0 1px #3b82f6;
}

input:checked+.slider:before {
    transform: translateX(14px);
}