/* styles.css */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-y: scroll; /* Ensure the body itself is scrollable */
    background-color: #f5f5f5;
    color: #0d47a1; /* Dark Blue */
    font-family: 'Arial', sans-serif;
    transition: padding-top 0.3s ease-in-out; /* Add transition for padding-top */
}

a, u {
    background-color: transparent !important;
}

.title{
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    color: #003366; /* Dark Blue */
    text-align: center;
    font-weight: 900;
}

.subheader{
    font-size: 1em;
    color: grey;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px;
    border-radius: 8px;
}

.defaults{
    font-size: 16px;
    line-height: 1.4;
    max-width: 75ch;
    margin: 10px 0; /* Adding some vertical spacing around the section */
    padding: 40px; /* 25px padding top-bottom and 40px padding left-right */
}

#editor {
    position: relative;
    height: 100px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    background-color: white;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
}

#quill-editor {
    border: none;
}

#editor:hover {
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

#quill-editor {
    height: 100%;
}

#quill-editor, 
#quill-editor * {
    color: black !important;  /* Enforce black text in edit mode */
}

#quill-editor a {
    background-color: transparent !important;  /* Ensure links remain transparent in edit mode */
    color: #007BFF !important;  /* Ensure links remain blue in edit mode */
    text-decoration: underline;
}

#quill-editor a:hover {
    color: #0056b3 !important;  /* Darker blue on hover */
}

.controls {
    display: none;
}

button {
    font-size: 16px;
    padding: 5px 10px;
    margin: 0 5px;
}

select  {
    font-size: 16px;
    padding: 5px 10px;
    margin: 0 5px;
    background-color: buttonface;
}

.color-scheme-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

#color-scheme-button {
    color: black;
    font-size: 16px;
    cursor: pointer;
    border: transparent;
    background-color: transparent;
    height: 100%;
}

.toolbar-button:hover {
    background-color: #e6e6e6; /* Change color on hover */
}

.ql-editor p{
    font-size: 16px;
    line-height: 1.4;
}

.ql-editor{
    padding: 15px;
}

.paste-text-above-button {
    background-color: #007BFF;
    font-size: 16px;
    color: white;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-left: auto;
    margin-right: auto;
    max-width: 75ch;
}

.paste-text-above-button:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.before-or-after-text{
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    margin: 10px 20px;
}

#hard-to-read-example p:first {
    margin-top: 0;
}

#easy-to-read-example {
    margin-left: auto;
    margin-right: auto;
    background-color: white;
    border: 1px solid #ccc;
    color: black;
    background: white; /* Ensure the background is white for readability */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Optional: Adds a subtle shadow for depth */
    border-radius: 5px;
    width: fit-content;
}

#easy-to-read-example div{
    max-width: 65ch;
}

#easy-to-read-example p:first {
    margin-top: 0;
}

#text-display ol,
#text-display ul {
    margin: 0;
    padding-left: 20px;
}

#hard-to-read-image {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}

/* styles.css */

#text-display {
    white-space: pre-wrap; /* Ensure text wraps correctly */
    overflow-wrap: break-word; /* Break long words to prevent overflow */
    word-wrap: break-word; /* Older browser compatibility */
    margin: 0px;
    max-width: 65ch;
    transition: font-family 0.3s ease, font-size 0.3s ease, line-height 0.3s ease, color 0.3s ease, background-color 0.3s ease; /* Add transition properties */
}

#text-display,
#text-display * {
    color: inherit; /* Inherit color for all child elements */
}

.white-on-black {
    background-color: black;
    color: white;
}

.black-on-white {
    background-color: white;
    color: black;
}

/* Additional color schemes */
.dark-on-light-accent {
    background-color: #f0f0f0;
    color: #333333;
}

.high-contrast {
    background-color: #000000;
    color: #ffff00;
}

.earthy-tones {
    background-color: #e0d6c6;
    color: #4d2e1a;
}

.retro-vintage {
    background-color: #ff00ff;
    color: #00ffff;
}

.vibrant-accent {
    background-color: #FF6347;
    color: #FFFFFF;
}

.coding-colors {
    background-color: #282c34;
    color: #61dafb;
}

.email {
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 12px;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.email-body {
    color: grey;
    background-color: #cccccc;
}

.sender {
    font-weight: bold;
}

.date {
    color: #5f6368;
}

.email-content {
    line-height: 1.4;
}

#mail-account{
    font-weight: 100;
    color: #5f6368;
}

/* Style for Quill editor placeholder */
.ql-editor.ql-blank::before {
    font-size: 18px;     /* Increase font size */
    color: #0056b3;      /* Darker blue color for emphasis */
    font-weight: bold;   /* Bold text */
    opacity: 0.8;        /* Slight opacity for subtle effect */
    content: 'Paste text here'; /* Customize the placeholder text if needed */
}

.toolbar-container {
    max-width: 80ch;
    padding: 0px;
    background-color: white;
    box-shadow: none;
    background-color: transparent;
    height: 100%;
}

#color-container .color-square {
    display: inline-block;
    width: 30px;
    height: 30px;
    margin: 5px;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.toolbar-container {
    max-width: 75ch;
    padding: 0px;
    background-color: white;
    box-shadow: none;
    background-color: transparent;
}

.color-scheme-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

#color-container {
    position: absolute;
    top: 40px;
    left: 0;
    display: none;
    flex-wrap: wrap;
    width: 150px;
    justify-content: center;
    background: #f1f1f1;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    z-index: 100;
}

.color-square {
    width: 30px;
    height: 30px;
    margin: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px; /* Rounded corners for color squares */
}

#add-to-chrome {
    border: 0px;
}

.flex-container {
    display: flex;
    justify-content: space-between;
    height: 100%;
}

#readable-container{
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 40px;
    border: 1px solid #c7c7c7;
    line-height: 1.4;
    font-size: 16px;
    border-radius: 5px;
    transition: font-family 0.3s ease, font-size 0.3s ease, line-height 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Add this CSS */
/* styles.css */
.navbar {
    background-color: #edf2fa;
    margin: 10px auto;
    max-width: 80ch;
    border-radius: 30px;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    padding: 0px;
    height: 50px;
    transition: transform 0.3s ease-in-out;
    border: 1px solid rgb(199, 199, 199);
    top: 0px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px;
}

.hidden{
    display: none;
}

.navbar.hidden {
    transform: translate(-50%, -200%);
}

.arrow-button {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: #edf2fa;
    color: black;
    border: 1px solid #c7c7c7;
    border-radius: 50%;
    padding: 10px 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.arrow-button.hidden {
    display: none;
}

.arrow-button:hover {
    background-color: #cfcfcf;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}


#back-to-reading-button {
    display: none; /* Initially hide the button */
    font-size: 16px;
    color: white;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-left: auto;
    margin-right: auto;
    max-width: 75ch;
    background-color: #007BFF;
}

#back-to-reading-button:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.font-dropdown {
    position: relative;
    display: inline-block;
}

.icon-button {
    font-size: 16px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 5px;
    color: inherit;
}

.toolbar-button {
    border: 1px solid transparent;
    background-color: transparent;
    cursor: pointer;
    margin: 0;
    padding: 0;
    width: 50px;
    text-align: center;
}

.toolbar-button .icon-button{
    color: black;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
    color: black;
    text-align: left;
    font-size: 16px;
    width: max-content;
}

.dropdown-content div {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dropdown-content div:hover {
    background-color: #dce1e9;
}

#quill-editor h2, #quill-editor p:first-child {
    margin-top: 0;
}

.selected-item {
    background-color: #dce1e9; /* Light background color */
    font-weight: bold;         /* Bold text */
}

.selected-color {
    border: 2px solid #007BFF; /* Blue border to indicate selection */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3); /* Optional: subtle shadow for depth */
    border-radius: 4px;
}

/* Tooltip styling positioned directly below the button */
.toolbar-button[data-tooltip-visible="true"]:hover::after {
    content: attr(data-tooltip);
    top: calc(100% + 5px); /* Position the tooltip just below the button with a 5px gap */
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
}

/* Show tooltip only if data-tooltip-visible is set to true */
.toolbar-button[data-tooltip-visible="true"]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Hide tooltip when .hide-tooltip is applied */
.hide-tooltip::after {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Tooltip styling for arrow buttons */
.arrow-button[data-tooltip-visible="true"]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 5px); /* Position below the arrow with a small gap */
    left: 0%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
}

/* Show tooltip only if data-tooltip-visible is set to true */
.arrow-button[data-tooltip-visible="true"]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Ensure list markers display correctly in reading mode */
#text-display ul {
    list-style-type: disc; /* Bullet points for unordered lists */
    padding-left: 20px; /* Add padding for indentation */
}

#text-display ol {
    list-style-type: decimal; /* Numbers for ordered lists */
    padding-left: 20px; /* Add padding for indentation */
}

#text-display ul li, #text-display ol li {
    margin-bottom: 8px; /* Add spacing between list items */
}

#hard-to-read-example {
    position: relative; /* Ensure the button is positioned relative to this container */
}

.copy-to-clipboard {
    position: absolute;
    top: -25px;
    right: -16px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.copy-to-clipboard:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.copy-to-clipboard i {
    font-size: 16px;
}

.ql-editor p, .ql-editor ol, .ql-editor pre, .ql-editor blockquote, .ql-editor h1, .ql-editor h2, .ql-editor h3, .ql-editor h4, .ql-editor h5, .ql-editor h6 {
    margin: 1em 0;
}

.font-option {
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.font-option:hover {
    background-color: #f0f0f0;
}
.selected-item {
    font-weight: bold;
    background-color: #e0e0e0;
}

/* Only show #menu-icon on mobile devices */
@media (min-width: 769px) {
    #menu-icon {
        display: none;
    }
    .options-screen {
        display: none;
    }
}

/* Media query for mobile devices */
/* Hide toolbar by default on mobile */
@media (max-width: 768px) {
    nav {
        display: none;
    }

    .menu-icon {
        font-size: 24px;
        cursor: pointer;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 100;
        background-color: white;
        padding: 5px 9px;
        border: 1px solid black;
        border-radius: 25px;
        box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
    }

    .menu-icon i {
        color: black;
    }

    .toolbar-screen,
    .options-screen {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: white;
        z-index: 101;
        transition: transform 0.3s ease;
        overflow-y: scroll;
        margin: auto;
    }

    .toolbar-screen.hidden,
    .options-screen.hidden {
        display: none;
    }

    .mobile-toolbar-button,
    .back-button,
    .close-button {
        font-size: 24px;
        padding: 20px 0;
        text-align: center;
        cursor: pointer;
        width: 100%;
        border-bottom: 1px solid #ddd;
    }

    .mobile-toolbar-button i,
    .back-button i,
    .close-button i {
        font-size: 36px;
    }

    #toolbar-nav, .navbar,
    .arrow-button {
        display: none !important;
    }

    .no-scroll {
        overflow: hidden;
    }

    /* Style for the font options container */
    .font-options {
        width: 100%;
        text-align: center;
    }

    /* Style each font option to look like buttons */
    .mobile-select-option {
        font-size: 18px;
        padding: 15px;
        cursor: pointer;
        border-bottom: 1px solid #ddd;
        transition: background-color 0.2s ease;
    }

    #options-content {
        font-weight: bold;
        font-size: 24px;
        text-align: center;
        cursor: pointer;
        width: 100%;
    }

    #readable-container {
        padding: 60px 40px;
        border: none;
        border-radius: 0px;
        min-height: 100vh;
    }

    html, body {
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        max-width: 100vw !important;
        overflow: hidden !important;
        overflow-y: auto !important;
      }
    html ::-webkit-scrollbar {
        display: none;
    }
    .container {
        padding-bottom: 200px;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Hide everything by default */
    body > * {
        display: none !important;
    }

    /* Specifically show the container and readable-container */
    .container, #readable-container, #text-display, #text-display * {
        display: block !important;
    }

    /* Hide siblings of readable-container within .container */
    .container > *:not(#readable-container) {
        display: none !important;
    }

    .container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #readable-container {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    #text-display {
        margin: 0 !important;
        padding: 20mm !important; /* Standard print margins */
        display: block !important;
    }

    /* Preserve colors if possible */
    #readable-container, #text-display, #text-display * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}