/* Custom Styles to Match QuillBot Detector */
:root {
    /* Color scheme */
    --qb-teal: #11a084;
    --qb-light-teal: #e6f7f2;
    --qb-orange: #ff9933;
    --qb-light-orange: #ffc78b;
    --qb-blue: #79a6d7;
    --qb-light-gray: #f0f0f0;
    --qb-gray: #5d6671;
}

body {
    background-color: #f7f9fb; /* Light background for the page */
}
/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 33, 71, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-light);
}
.ai-detector-header {
    padding: 60px 20px; /* Ample padding top/bottom */
    text-align: center;
}

.ai-detector-header h1 {
    font-size: 3rem; /* Large, prominent heading */
    font-weight: 700; /* Bold */
    color: #1a3c63; /* Dark blue color from the image */
    margin-bottom: 15px; /* Space between heading and sub-text */
}

.ai-detector-header p {
    font-size: 1.1rem; /* Slightly larger sub-text */
    color: var(--qb-gray); /* Subtler gray color */
    max-width: 700px; /* Constrain width for readability */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6; /* Good line spacing */
}

/* Main Card Styling */
.quillbot-detector-card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e4e8;
    max-width: 1100px;
    margin: auto;
}

/* Language Tabs Styling */
.language-tab {
    color: var(--qb-gray);
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-right: 15px;
    padding: 8px 10px;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.language-tab.active,
.language-tab:hover {
    color: #000;
    border-bottom: 2px solid var(--qb-teal);
}

.nav-tabs {
    border-bottom: none !important;
}

/* Dropdown Menu Multi-column Styling */
.language-dropdown-menu {
    min-width: 500px; 
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.language-list-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 5px 10px;
}

.language-item {
    display: block; /* Makes the entire area clickable */
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #343a40;
    cursor: pointer;
    transition: background-color 0.15s;
}

.language-item:hover {
    background-color: #f0f0f0;
}

/* Selected language style */
.language-item.selected {
    background-color: var(--qb-light-teal); /* Light green background */
    color: #000;
    font-weight: 600;
}

/* Checkmark icon styling */
.checkmark {
    color: var(--qb-teal);
    font-size: 1.1rem;
    margin-left: 5px;
    vertical-align: middle;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    appearance: none;
    min-width: 64px;
    width: 100%;
    font-size: 16px;
    font-family: "Open Sans", sans-serif;
    font-weight: 600;
    line-height: 24px;
    background-color: transparent;
    height: 40px;
    color: rgb(0, 136, 71);
    text-transform: none;
    opacity: 1;
    box-shadow: none !important;
    outline: 0px;
    margin: 0px;
    text-decoration: none;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms cubic-bezier(0.4, 0, 0.2, 1), color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    padding: 8px 20px;
    border-width: 1px;
    border-style: solid;
    border-image: initial;
    border-color: rgb(0, 136, 71);
}

.action-btn:hover {
    background-color: rgba(0, 136, 71, 0.08);
    border-color: rgb(17, 87, 53);
    color: rgb(17, 87, 53) !important;
}

/* Text Input Area Container (the main box) */
.text-input-container {
    position: relative;
    min-height: 350px; /* Gives space for the text area */
    border-radius: 8px;
    background-color: #fff;
    padding: 15px 15px 0px; /* Padding for the content inside */
}

/* Textarea specific styles */
#textAnalyzer {
    width: 100%;
    height: 100%;
    min-height: 320px; /* Minimum visible height */
    resize: none;
    border: none;
    outline: none;
    padding: 0;
    margin: 0;
    background-color: transparent; /* Ensure text flows over other elements */
    font-size: 1rem;
    display: block;
}

/* Results display area - now in the same container as textarea */
#resultsDisplay {
    width: 100%;
    height: 100%;
    min-height: 320px;
    padding: 0;
    margin: 0;
    font-size: 1rem;
    overflow-y: auto;
    display: none; /* Hidden by default */
}

/* Elements for the initial empty state */
.empty-state-elements {
    position: absolute;
    top: 20px;
    left: 15px;
    right: 15px;
    pointer-events: none; /* Allows clicks to go through to the textarea */
}

/* Delete Icon style */
.clear-text-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1rem;
    opacity: 0.8;
    cursor: pointer;
    color: rgb(44, 62, 93);
    z-index: 10; /* Ensures it's above the textarea */
    transition: opacity 0.2s;
}

.clear-text-btn:hover {
    opacity: 1;
}

/* Hide the delete button by default */
.clear-text-btn.d-none {
    display: none !important;
}

/* Word Counter Display */
#wordCountDisplay {
    font-size: 1rem;
    color: var(--qb-gray);
    font-weight: 600;
}

/* Right section */
.right-section {
    border-left: 1px solid #e0e4e8;
    padding-left: 30px !important;
}

@media (max-width: 768px) {
    .right-section {
        border-left: none;
        border-top: 1px solid #e0e4e8;
        padding-left: 0 !important;
        padding-top: 20px; /* optional */
    }
}

/* Color dot for categories */
.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    /* Border for the white dot */
    border: 1px solid rgba(0, 0, 0, 0.1); 
}

.analysis-item {
    font-size: 0.95rem;
    color: #495057;
}

/* Detect AI Button */
.detect-ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    appearance: none;
    min-width: 64px;
    font-size: 16px;
    font-family: "Open Sans", sans-serif;
    font-weight: 600;
    line-height: 24px;
    background-color: rgb(0, 136, 71);
    height: 40px;
    color: rgb(255, 255, 255);
    text-transform: none;
    opacity: 1;
    box-shadow: none !important;
    outline: 0px;
    border-width: 0px;
    border-style: initial;
    border-color: initial;
    border-image: initial;
    margin: 0px;
    text-decoration: none;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1), border-color 250ms cubic-bezier(0.4, 0, 0.2, 1), color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    padding: 8px 20px;
}

.detect-ai-btn:hover {
   background-color: rgb(17, 87, 53);
}

.detect-ai-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Enhanced Text highlighting styles with badges */
.ai-text-high {
    background-color: rgba(255, 153, 51, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: help;
    position: relative;
    /*border-left: 3px solid var(--qb-orange);*/
    margin: 2px 0;
    /*display: inline-block;*/
}

.ai-text-medium {
    background-color: rgba(13, 110, 253, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: help;
    position: relative;
    /*border-left: 2px solid var(--bs-primary);*/
    margin: 2px 0;
    /*display: inline-block;*/
}

.ai-text-low {
    background-color: rgba(0, 136, 71, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    cursor: help;
    position: relative;
    /*border-left: 2px solid var(--qb-teal);*/
    margin: 2px 0;
    /*display: inline-block;*/
}

/* Badge styling */
.ai-badge, .ai-refined-badge, .human-badge {
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    margin-right: 4px;
    vertical-align: middle;
    font-weight: 600;
}

/* Hover effects */
/* .ai-text-high:hover, .ai-text-medium:hover, .ai-text-low:hover {
    opacity: 0.9;
    transform: scale(1.01);
} */

/* Loader styles */
.loader-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 136, 71, 0.3);
    border-radius: 50%;
    border-top-color: var(--qb-teal);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Language change notification */
.language-notification {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--qb-teal);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1100;
    animation: fadeOut 3s forwards;
    animation-delay: 2s;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

/* Toggle button to switch between input and results */
.toggle-view-btn {
    background-color: transparent;
    border: none;
    color: var(--qb-teal);
    font-weight: 600;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.toggle-view-btn:hover {
    background-color: var(--qb-light-teal);
}

/* Reset button */
.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 32px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

.reset-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Results display styling */
.results-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e4e8;
}

.analysis-complete {
    color: var(--qb-teal);
    font-weight: 600;
    margin-bottom: 15px;
}

.authentic-text {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Vertical Progress Bar Styles */
.progress-container {
    margin: 20px 0;
}

.vertical-progress-bars {
    height: auto;
}

.vertical-bar-container {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    width: 30%;
    height: 120px;
}

.vertical-bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease-in-out;
    min-height: 20px; /* Minimum height to show even for low percentages */
}

.ai-bar {
    background-color: var(--qb-orange);
}

.ai-refined-bar {
    background-color: var(--qb-blue);
}

.human-bar {
    background-color: #198754;
}

.bar-label {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.ai-bar + .bar-label {
    color: var(--qb-orange);
}

.ai-refined-bar + .bar-label {
    color: var(--qb-blue);
}

.human-bar + .bar-label {
    color: #6c757d;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.ai-label {
    color: var(--qb-orange);
}

.human-label {
    color: #6c757d;
}

/* Text analysis legend with badges */
.text-analysis-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85em;
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.legend-title {
    font-weight: 600;
    width: 100%;
    margin-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.legend-color.ai-text-high {
    background-color: rgba(255, 153, 51, 0.3);
}

.legend-color.ai-text-medium {
    background-color: rgba(13, 110, 253, 0.1);
}

.legend-color.ai-text-low {
    background-color: rgba(0, 136, 71, 0.1);
}

/* Highlight controls */
.highlight-controls {
    margin-bottom: 15px;
}

.highlight-controls .btn-group {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* AI Explanation Card */
.ai-explanation {
    margin-top: 20px;
    margin-bottom: 15px;
}

.ai-explanation h5 {
    font-weight: 600;
    color: var(--qb-gray);
    margin-bottom: 10px;
}

.ai-explanation .card {
    border-color: #e0e4e8;
    border-radius: 8px;
}

.ai-explanation .card-body {
    padding: 15px;
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.5;
}
