/* Accessibility Button */
#accessibilityBtn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #2050b3;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border: 2px solid white;
    transition: transform 0.3s, background-color 0.3s;
}

#accessibilityBtn:hover {
    transform: scale(1.1);
    background-color: #1a3f8e;
}

/* Accessibility Menu */
#accessibilityMenu {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 300px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 999;
    display: none;
    max-height: 80dvh;
    overflow-y: auto;
}

#accessibilityMenu.active {
    display: block;
}

#accessibilityMenu h3 {
    margin-top: 0;
    text-align: center;
    color: #2050b3;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

/* Option Groups */
.option-group {
    margin-bottom: 20px;
}

.option-group h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
    font-size: 16px;
}

/* Pretty Buttons */
.option-btn {
    display: inline-block;
    padding: 8px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #333;
}

.option-btn:hover {
    background-color: #e9e9e9;
    border-color: #ccc;
}

.option-btn.active {
    background-color: #2050b3;
    color: white;
    border-color: #0d3d8e;
}

/* Reset button */
#resetBtn {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    transition: background-color 0.2s;
}

#resetBtn:hover {
    background-color: #d32f2f;
}

/* Applied styles */
body.high-contrast {
    background-color: black;
    color: white;
}

body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4 {
    color: yellow;
}

body.high-contrast a {
    color: #00ccff;
}

body.yellow-black {
    background-color: black;
    color: yellow;
}

body.yellow-black a {
    color: #ffff00;
    text-decoration: underline;
}

body.black-yellow {
    background-color: yellow;
    color: black;
}

body.large-text {
    font-size: 18px;
}

body.larger-text {
    font-size: 20px;
}

body.largest-text {
    font-size: 24px;
}

body.increased-spacing {
    line-height: 2;
    letter-spacing: 1px;
}

body.wider-spacing {
    line-height: 2.5;
    letter-spacing: 2px;
}

body.highlight-links a {
    background-color: yellow;
    color: blue;
    text-decoration: underline;
    padding: 0 3px;
}

body.highlight-titles h1,
body.highlight-titles h2,
body.highlight-titles h3,
body.highlight-titles h4,
body.highlight-titles h5,
body.highlight-titles h6 {
    background-color: #ffff99;
    padding: 5px;
}

body.reading-guide {
    position: relative;
}

#reading-guide-line {
    position: fixed;
    left: 0;
    height: 30px;
    width: 100%;
    background-color: rgba(255, 255, 0, 0.2);
    pointer-events: none;
    z-index: 1000;
    display: none;
} 

.accessibility-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.tab-btn {
    padding: 6px 16px;
    border: none;
    background: #eee;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-weight: bold;
    transition: background 0.2s;
}
.tab-btn.active {
    background: #d1eaff;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}
#content-summary {
    align-items: center;
    justify-content: center;
    text-align: justify;
}
.summary-btn {
    display: block;
    margin: 16px auto 0 auto; 
    padding: 8px 12px;
    background-color: #2050b3;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: white;
    border-color: #0d3d8e;
}
.summary-btn:hover {
    background-color: #357ae8;
    color: white;
    border-color: #2050b3;
}
.summary-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.summary-img {
    width: 80px;     
    height: auto;
    margin-bottom: 2px;
    margin-left: 14px;
    display: block;
}
#content-chatbot {
    align-items: center;
    justify-content: center;
    text-align: justify;
}
.chatbot-img {
    width: 80px;     
    height: auto;
    margin-bottom: 2px;
    margin-left: 4px;
    display: block;
}

.summary-result {
    margin-top: 16px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #2050b3;
}

.summary-result h4 {
    margin: 0 0 8px 0;
    color: #2050b3;
    font-size: 14px;
}

.summary-result p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

/* === Summary Overlay === */
.summary-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(32, 80, 179, 0.75); /* albastru semi-transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.summary-modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    padding: 32px 28px 24px 28px;
    max-width: 480px;
    width: 90vw;
    text-align: center;
    position: relative;
    animation: summary-modal-fadein 0.25s;
}

@keyframes summary-modal-fadein {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.summary-modal-content h3 {
    margin-top: 0;
    color: #2050b3;
    font-size: 1.4em;
    margin-bottom: 16px;
}

.summary-modal-content p {
    font-size: 1.1em;
    color: #222;
    margin-bottom: 0;
    word-break: break-word;
}

.summary-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 2em;
    color: #2050b3;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.summary-modal-close:hover {
    color: #f44336;
}

/* === CHATBOT === */
#chatbot-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(32, 80, 179, 0.75); /* albastru semitransparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
#chatbot-modal {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-width: 700px;
    width: 90vw;
    max-height: 80vh;
    height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
#chatbot-modal > div {
    font-family: inherit;
}
#chatbot-modal .chatbot-msg {
    margin: 10px 0;
    padding: 10px 16px;
    border-radius: 8px;
    max-width: 80%;
    word-break: break-word;
    font-size: 1em;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(32,80,179,0.04);
}
#chatbot-modal .chatbot-msg-user {
    background: #2050b3;
    color: #fff;
    align-self: flex-end;
    margin-left: 20%;
}
#chatbot-modal .chatbot-msg-bot {
    background: #e9f0ff;
    color: #222;
    align-self: flex-start;
    margin-right: 20%;
}
#chatbot-modal input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    font-size: 1em;
    border: 1px solid #2050b3;
    border-radius: 6px;
    margin-right: 12px;
    outline: none;
}
#chatbot-modal button {
    background: #2050b3;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}
#chatbot-modal button:hover {
    background: #357ae8;
}
#chatbot-modal button[style*="background: transparent"] {
    background: transparent !important;
    color: #2050b3;
    font-size: 2em;
    position: absolute;
    top: 16px;
    right: 24px;
    padding: 0;
    border: none;
    box-shadow: none;
}
#chatbot-modal button[style*="background: transparent"]:hover {
    color: #f44336;
}
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 12px 24px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

/* === CHATBOT LOADING ANIMATION === */
.chatbot-loading .chatbot-dots {
    display: inline-block;
}
.chatbot-loading .chatbot-dots span {
    opacity: 0.2;
    animation: chatbot-dots-blink 1.2s infinite;
    font-size: 1.5em;
    margin-right: 2px;
}
.chatbot-loading .chatbot-dots span:nth-child(1) {
    animation-delay: 0s;
}
.chatbot-loading .chatbot-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.chatbot-loading .chatbot-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes chatbot-dots-blink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}

@media (max-width: 600px) {
  #accessibilityBtn {
    width: 44px;
    height: 44px;
    bottom: 60px; 
    right: 12px;
  }
  #accessibilityMenu {
    bottom: 74px;
    right: 8px;
    max-height: 70vh;
  }
  #chatbot-modal {
    max-width: 98vw;
    width: 98vw;
    height: 90vh;
    min-width: unset;
    border-radius: 10px;
    margin-bottom: 30px;
  }
  #chatbot-messages {
    padding: 0 6px 8px 6px;
    font-size: 0.98em;
  }
  #chatbot-modal .chatbot-msg {
    font-size: 0.98em;
    padding: 8px 8px;
    margin: 6px 0;
  }
  #chatbot-modal .chatbot-msg-user,
  #chatbot-modal .chatbot-msg-bot {
    margin-left: 0;
    margin-right: 0;
    max-width: 95%;
  }
  #chatbot-modal input[type="text"] {
    font-size: 1em;
    padding: 10px 8px;
    margin-right: 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  #chatbot-modal button {
    font-size: 1em;
    padding: 10px 0;
    width: 100%;
    margin-top: 8px;
    border-radius: 6px;
  }
  #chatbot-modal > div:last-child, #chatbot-modal .input-area, #chatbot-modal .input-area {
    flex-direction: column !important;
    padding: 10px 6px 10px 6px !important;
    gap: 0;
  }
  #chatbot-modal > div[style*="display: flex"] {
    flex-direction: column !important;
    padding: 10px 6px 10px 6px !important;
    gap: 0;
  }
  #chatbot-modal button[style*="background: transparent"] {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    z-index: 10;
}
}

/* === Buton contextual selectie pentru chatbot === */
.selection-chatbot-btn {
    position: absolute;
    z-index: 4000;
    padding: 6px;
    border-radius: 50%;
    background: #1875c2; 
    border: none;
    box-shadow: 0 2px 8px rgba(32,80,179,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #fff;
    font-size: 1.2em;
    transition: background 0.2s;
    opacity: 0;
    animation: chatbot-fadein 0.5s forwards;
}

@keyframes chatbot-fadein {
    from { opacity: 0; transform: scale(0.85);}
    to   { opacity: 1; transform: scale(1);}
}
.selection-chatbot-btn:hover {
    background: #b6e0fe; 
}
.selection-chatbot-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: transparent;
    background-image: url('../Images & Videos/chatbot_textselectionimage.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}