/**
 * Frontend Styles for GPTDetector
 * Modern dark theme with neon accents
 */

/* CSS Variables - Matching modern-ai-detector-theme */
:root {
    --gptd-primary: #00D9FF;
    --gptd-secondary: #00F5A0;
    --gptd-warning: #FFB800;
    --gptd-danger: #FF3838;
    --gptd-success: #00F5A0;
    
    /* Theme-aware variables */
    --gptd-bg-primary: #0A0F1C;
    --gptd-bg-secondary: #151B2C;
    --gptd-bg-tertiary: #2A3344;
    --gptd-text-primary: #FFFFFF;
    --gptd-text-secondary: #8892B0;
    --gptd-text-muted: rgba(255, 255, 255, 0.7);
    --gptd-border-color: rgba(255, 255, 255, 0.1);
    --gptd-border-light: rgba(255, 255, 255, 0.05);
    
    /* Legacy variables for backward compatibility */
    --gptd-dark: #0A0F1C;
    --gptd-dark-light: #151B2C;
    --gptd-gray: #2A3344;
    --gptd-gray-light: #8892B0;
    --gptd-white: #FFFFFF;
}

/* Light mode CSS variable overrides */
:root[data-theme="light"],
html[data-theme="light"],
body.light-mode,
body[data-theme="light"] {
    /* Theme-aware variables */
    --gptd-bg-primary: #ffffff;
    --gptd-bg-secondary: #f8f9fa;
    --gptd-bg-tertiary: #e9ecef;
    --gptd-text-primary: #212529;
    --gptd-text-secondary: #6c757d;
    --gptd-text-muted: rgba(0, 0, 0, 0.6);
    --gptd-border-color: rgba(0, 0, 0, 0.1);
    --gptd-border-light: rgba(0, 0, 0, 0.05);
    
    /* Legacy variables for backward compatibility */
    --gptd-dark: #ffffff;
    --gptd-dark-light: #f8f9fa;
    --gptd-gray: #e9ecef;
    --gptd-gray-light: #6c757d;
    --gptd-white: #212529;
}

/* Additional light mode overrides for history sidebar elements */
:root[data-theme="light"] .history-sidebar-header,
html[data-theme="light"] .history-sidebar-header {
    background: var(--gptd-dark-light) !important;
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

:root[data-theme="light"] .history-user-info,
html[data-theme="light"] .history-user-info {
    background: rgba(0, 0, 0, 0.03) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .history-sidebar-footer,
html[data-theme="light"] .history-sidebar-footer {
    background: var(--gptd-dark-light) !important;
    border-top-color: rgba(0, 0, 0, 0.1) !important;
}

/* Main Wrapper */
.gptdetector-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gptd-dark-light);
    color: var(--gptd-white);
    border-radius: 16px;
    padding: 24px 28px 20px;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Enhanced Input Section */
.gptdetector-input-section {
    margin-bottom: 2rem;
}

/* Textarea Header with Counters */
.textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding:20px;
    padding-bottom: 0px;
}

.textarea-label {
    color: var(--gptd-text);
    font-size: 15px;
    font-weight: 500;
}

/* Input Method Tabs */
.input-methods {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    background: var(--gptd-dark);
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
}

.input-method-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--gptd-gray-light);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-method-btn i {
    font-size: 1rem;
}

.input-method-btn.active {
    background: var(--gptd-primary);
    color: var(--gptd-dark);
}

.input-method-btn:hover:not(.active) {
    color: var(--gptd-white);
    background: rgba(255, 255, 255, 0.05);
}

/* URL Input Container */
.url-input-container {
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.url-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--gptd-dark);
    border: 2px solid var(--gptd-gray);
    border-radius: 10px;
    padding: 0.5rem 1rem;
    transition: border-color 0.3s;
}

.url-input-wrapper:focus-within {
    border-color: var(--gptd-primary);
}

.url-input-wrapper i {
    color: var(--gptd-gray-light);
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--gptd-white);
    font-size: 1rem;
    outline: none;
}

.url-input::placeholder {
    color: var(--gptd-gray-light);
    opacity: 0.6;
}

.load-url-btn {
    padding: 0.5rem 1.25rem;
    background: var(--gptd-primary);
    color: var(--gptd-dark);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.load-url-btn:hover {
    background: var(--gptd-secondary);
    transform: translateY(-1px);
}

.url-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--gptd-primary);
    font-size: 0.9rem;
}

.url-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-top-color: var(--gptd-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gptdetector-input {
    width: 100%;
    min-height: 300px;
    background: var(--gptd-dark);
    border: 2px solid var(--gptd-gray);
    border-radius: 10px;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gptd-white);
    resize: vertical;
    transition: all 0.3s;
    font-family: inherit;
}

.gptdetector-input:focus {
    outline: none;
    border-color: var(--gptd-primary);
}

.gptdetector-input::placeholder {
    color: var(--gptd-gray-light);
    opacity: 0.7;
}

/* Counters */
/* Word Counter */
.gptdetector-word-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.gptdetector-word-counter #word-count {
    font-weight: 600;
    color: var(--gptd-primary);
    transition: color 0.3s ease;
}

.gptdetector-word-counter .counter-divider {
    color: var(--gptd-gray-light);
    opacity: 0.5;
}

.gptdetector-word-counter #word-limit {
    color: var(--gptd-gray-light);
}

.gptdetector-word-counter .counter-label {
    color: var(--gptd-gray-light);
    font-size: 13px;
}

/* Warning state (90% of limit) */
.gptdetector-word-counter.warning {
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.3);
}

.gptdetector-word-counter.warning #word-count {
    color: var(--gptd-warning);
}

/* Error state (over limit) */
.gptdetector-word-counter.error {
    background: rgba(255, 56, 56, 0.1);
    border: 1px solid rgba(255, 56, 56, 0.3);
}

.gptdetector-word-counter.error #word-count {
    color: var(--gptd-danger);
}

/* Controls */
.gptdetector-controls {
    margin-top: 20px;
}

.gptdetector-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.gptdetector-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.gptdetector-btn-primary {
    background: var(--gptd-primary);
    color: #0F1117;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.gptdetector-btn-primary:hover {
    background: #00C2E6;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.gptdetector-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gptdetector-btn-secondary {
    background: #00D9FF;
    color: #0F1117;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.gptdetector-btn-secondary:hover {
    background: #00C2E6;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.gptdetector-btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gptd-text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gptdetector-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--gptd-text);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.gptdetector-btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.secondary-buttons {
    display: flex;
    gap: 12px;
}

/* Compact Limits Info */
.gptdetector-limits-info {
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(0, 217, 255, 0.02);
    border: 1px solid rgba(0, 217, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.limits-bars {
    display: flex;
    gap: 25px;
    flex: 1;
}

.limit-bar {
    flex: 1;
    max-width: 200px;
}

.limit-bar-label {
    font-size: 13px;
    color: var(--gptd-text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.limit-bar-track {
    height: 4px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.limit-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gptd-primary), var(--gptd-secondary));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.limit-bar-fill.warning {
    background: linear-gradient(90deg, var(--gptd-warning), #FFA500);
}

.limits-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.limits-role {
    font-size: 13px;
    color: var(--gptd-text-muted);
    white-space: nowrap;
    padding: 5px 12px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 6px;
    font-weight: 500;
}

.limits-reset {
    font-size: 13px;
    color: var(--gptd-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 6px;
    font-weight: 500;
}

.reset-icon {
    width: 14px;
    height: 14px;
    color: var(--gptd-primary);
    opacity: 0.8;
}

/* Source Options Section */
.gptdetector-source-options {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.03), rgba(0, 245, 160, 0.03));
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.source-options-header h4 {
    margin: 0 0 5px 0;
    color: var(--gptd-text);
    font-size: 16px;
    font-weight: 600;
}

.source-options-header p {
    margin: 0 0 15px 0;
    color: var(--gptd-text-muted);
    font-size: 13px;
}

.source-options-container {
    display: flex;
    gap: 15px;
    align-items: center;
}

.url-load-wrapper {
    flex: 1;
}

.url-load-container {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.url-load-container:focus-within {
    border-color: var(--gptd-primary);
    background: rgba(0, 217, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.1);
}

.url-load-container i {
    color: var(--gptd-text-muted);
    font-size: 16px;
}

.gptdetector-url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--gptd-text);
    font-size: 14px;
    outline: none;
}

.gptdetector-url-input::placeholder {
    color: var(--gptd-text-muted);
}

/* Secondary button styles are defined above with other button styles */

/* File Upload */
.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gptdetector-btn-outline {
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid rgba(0, 217, 255, 0.25);
    color: var(--gptd-primary);
    padding: 10px 20px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.gptdetector-btn-outline:hover {
    background: rgba(0, 217, 255, 0.15);
    border-color: var(--gptd-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.2);
}

.file-info {
    font-size: 13px;
    color: var(--gptd-text-muted);
}

/* Status */
.source-load-status {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gptd-primary);
    font-size: 13px;
}

.source-load-status .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 217, 255, 0.2);
    border-top-color: var(--gptd-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* OR Divider */
.gptdetector-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.gptdetector-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.2), transparent);
}

.gptdetector-divider span {
    position: relative;
    background: var(--gptd-background);
    padding: 0 15px;
    color: var(--gptd-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Textarea Wrapper */
.gptdetector-textarea-wrapper {
    position: relative;
}

.textarea-label {
    display: block;
    margin-bottom: 8px;
    color: var(--gptd-text);
    font-size: 14px;
    font-weight: 500;
}

/* Note: Counter styles are defined above with textarea-header */

/* Loading Overlay */
.gptdetector-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 20px;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--gptd-gray);
    border-top-color: var(--gptd-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--gptd-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Results Section */
.gptdetector-results {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Horizontal Layout Container */
.gptdetector-score-models-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

/* Score Section - Left Side - Compact */
.gptdetector-score-section {
    flex: 0 1 auto;
    min-width: 320px;
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(0, 245, 160, 0.1));
    border-radius: 15px;
    border: 1px solid rgba(0, 217, 255, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.score-gauge {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

.score-gauge-svg {
    transform: rotate(-90deg);
}

.score-gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 12;
}

.score-gauge-progress {
    fill: none;
    stroke: var(--gptd-primary);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-gauge-progress.low {
    stroke: var(--gptd-success);
}

.score-gauge-progress.medium {
    stroke: var(--gptd-warning);
}

.score-gauge-progress.high {
    stroke: var(--gptd-danger);
}

/* Dual color for human-dominant display */
.score-gauge-progress.human-dominant {
    stroke: var(--gptd-success);
}

.score-gauge-ai {
    fill: none;
    stroke: var(--gptd-danger);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-in-out;
}

.score-gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value {
    font-size: 3rem;
    font-weight: bold;
    /* Color will be set dynamically by JavaScript based on score */
    display: block;
}

.score-label {
    font-size: 1rem;
    color: var(--gptd-gray-light);
    display: block;
    margin-top: -0.5rem;
}

.score-verdict {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Score Interpretation Section */
.score-interpretation {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.interpretation-tooltip {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.interpretation-tooltip:hover {
    color: rgba(255, 255, 255, 0.9);
}

.interpretation-tooltip i {
    font-size: 1.1rem;
    color: var(--gptd-primary);
}

.score-verdict.human {
    color: var(--gptd-success);
}

.score-verdict.mixed {
    color: var(--gptd-warning);
}

.score-verdict.ai {
    color: var(--gptd-danger);
}

/* Models Section - Right Side (60%) */
.gptdetector-models-section {
    flex: 1;
    padding: 1.5rem;
    background: var(--gptd-dark-light);
    border-radius: 15px;
    border: 1px solid var(--gptd-gray);
    display: flex;
    flex-direction: column;
}

.gptdetector-models-section h3 {
    font-size: 1.3rem;
    margin: 0 0 1.5rem 0;
    color: var(--gptd-white);
}

.models-section-title {
    text-align: center !important;
    font-size: 1.5rem !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.models-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex: 1;
}

.ai-models-group {
    flex: 0 0 auto;
}

.ai-models-group .models-grid,
.human-score-group .models-grid {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.human-score-separator {
    width: 1px;
    height: 60px;
    background: linear-gradient(180deg, transparent, var(--gptd-gray-light), transparent);
    opacity: 0.3;
    flex-shrink: 0;
    margin: 0 0.25rem;
}

.human-score-group {
    position: relative;
    flex: 0 0 auto;
}

.human-score-group::before {
    content: 'Human Content';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--gptd-gray-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0.7;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.model-item {
    text-align: center;
    padding: 1rem 0.75rem;
    background: var(--gptd-dark);
    border-radius: 12px;
    border: 1px solid var(--gptd-gray);
    transition: all 0.3s;
}

.model-item:hover {
    transform: translateY(-3px);
    border-color: var(--gptd-primary);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.2);
}

.model-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 0.75rem;
    background: linear-gradient(135deg, var(--gptd-primary), var(--gptd-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gptd-dark);
}

.model-icon i {
    font-size: 1.5rem;
    color: white;
    line-height: 1;
}

.model-name {
    display: block;
    color: var(--gptd-gray-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.model-score {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.model-item.low .model-score {
    color: var(--gptd-success);
}

.model-item.medium .model-score {
    color: var(--gptd-warning);
}

.model-item.high .model-score {
    color: var(--gptd-danger);
}

.model-bar {
    height: 4px;
    background: var(--gptd-gray);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.model-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gptd-primary), var(--gptd-secondary));
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Metrics Section */
.gptdetector-metrics-section {
    padding: 2rem;
    background: var(--gptd-dark-light);
    border-radius: 15px;
    border: 1px solid var(--gptd-gray);
    margin-bottom: 2rem;
}

.gptdetector-metrics-section h3 {
    font-size: 1.3rem;
    margin: 0 0 1.5rem 0;
    color: var(--gptd-white);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Summary card spans 2 columns */
.metric-item.summary-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), rgba(0, 245, 160, 0.05));
    border: 1px solid rgba(0, 217, 255, 0.15);
}

.summary-card .summary-text {
    margin: 1rem 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.summary-card .improvement-prompt {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-card .improvement-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.summary-card .improvement-prompt-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--gptd-primary);
}

.summary-card .copy-prompt-btn {
    padding: 0.4rem 0.8rem;
    background: var(--gptd-primary);
    color: var(--gptd-dark);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.summary-card .copy-prompt-btn:hover {
    background: var(--gptd-secondary);
    transform: translateY(-1px);
}

.summary-card .improvement-prompt-text {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.7;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.metric-item {
    padding: 1.5rem;
    background: var(--gptd-dark);
    border-radius: 12px;
    border: 1px solid var(--gptd-gray);
    transition: all 0.3s;
}

.metric-item:hover {
    transform: translateX(5px);
    border-color: var(--gptd-primary);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gptd-white);
}

.metric-level {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.metric-level.low {
    background: rgba(0, 245, 160, 0.2);
    color: var(--gptd-success);
}

.metric-level.medium {
    background: rgba(255, 217, 61, 0.2);
    color: var(--gptd-warning);
}

.metric-level.high {
    background: rgba(255, 82, 82, 0.2);
    color: var(--gptd-danger);
}

.metric-score-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.metric-score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gptd-primary);
}

.metric-progress {
    flex: 1;
    height: 8px;
    background: var(--gptd-gray);
    border-radius: 4px;
    overflow: hidden;
}

.metric-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gptd-primary), var(--gptd-secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.metric-explanation {
    color: var(--gptd-gray-light);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Sentences Section */
.gptdetector-sentences-section {
    padding: 2rem;
    background: var(--gptd-dark-light);
    border-radius: 15px;
    border: 1px solid var(--gptd-gray);
    margin-bottom: 2rem;
}

.gptdetector-sentences-section h3 {
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    color: var(--gptd-white);
}

.sentence-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gptd-dark);
    border-radius: 10px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gptd-gray-light);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.human {
    background: rgba(0, 245, 160, 0.3);
    border: 2px solid var(--gptd-success);
}

.legend-color.mixed {
    background: rgba(255, 217, 61, 0.3);
    border: 2px solid var(--gptd-warning);
}

.legend-color.ai {
    background: rgba(255, 82, 82, 0.3);
    border: 2px solid var(--gptd-danger);
}

.highlighted-text {
    line-height: 2;
    font-size: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.sentence-highlight {
    position: relative;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.sentence-highlight.human {
    background: rgba(0, 245, 160, 0.1);
    border-bottom: 2px solid var(--gptd-success);
}

.sentence-highlight.mixed {
    background: rgba(255, 217, 61, 0.1);
    border-bottom: 2px solid var(--gptd-warning);
}

.sentence-highlight.ai {
    background: rgba(255, 82, 82, 0.1);
    border-bottom: 2px solid var(--gptd-danger);
}

.sentence-highlight:hover {
    background: rgba(0, 217, 255, 0.1);
}

.sentence-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gptd-dark);
    border: 1px solid var(--gptd-primary);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    pointer-events: none;
    min-width: 200px;
}

.sentence-highlight:hover .sentence-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.sentence-tooltip strong {
    color: var(--gptd-primary);
    display: block;
    margin-bottom: 0.25rem;
}

/* Summary Section */
.gptdetector-summary-section {
    padding: 2rem;
    background: var(--gptd-dark-light);
    border-radius: 15px;
    border: 1px solid var(--gptd-gray);
}

.summary-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--gptd-gray-light);
    margin-bottom: 1.5rem;
}

.summary-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.improvement-prompt {
    padding: 1.5rem;
    background: var(--gptd-dark);
    border-radius: 10px;
    border: 1px solid var(--gptd-gray);
}

.improvement-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.improvement-prompt-header h4 {
    margin: 0;
    color: var(--gptd-primary);
}

.copy-prompt-btn {
    padding: 0.5rem 1rem;
    background: var(--gptd-gray);
    border: none;
    border-radius: 6px;
    color: var(--gptd-white);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-prompt-btn:hover {
    background: var(--gptd-primary);
    color: var(--gptd-dark);
}

.improvement-prompt-text {
    color: var(--gptd-gray-light);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Error Display */
.gptdetector-error {
    padding: 1.5rem;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid var(--gptd-danger);
    border-radius: 10px;
    margin-top: 1rem;
}

.error-message {
    color: var(--gptd-danger);
    font-size: 1rem;
}

/* Notifications */
.gptdetector-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--gptd-dark-light);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.gptdetector-notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--gptd-success);
}

.notification-error {
    border-left: 4px solid var(--gptd-danger);
}

.notification-warning {
    border-left: 4px solid var(--gptd-warning);
}

.notification-info {
    border-left: 4px solid var(--gptd-primary);
}

/* Models Disclaimer - Full Width */
.models-disclaimer {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

.models-disclaimer i {
    color: var(--gptd-warning);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.8;
}

.models-disclaimer strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

/* Human Model Card Styling */
.human-model {
    background: linear-gradient(135deg, rgba(0, 163, 42, 0.1), rgba(0, 163, 42, 0.05));
    border: 2px dashed rgba(0, 163, 42, 0.5);
}

.human-model .model-icon {
    background: var(--gptd-success);
    color: white;
}

.human-model.high-human .model-bar-fill {
    background: var(--gptd-success);
}

.human-model.medium-human .model-bar-fill {
    background: var(--gptd-warning);
}

.human-model.low-human .model-bar-fill {
    background: var(--gptd-danger);
}

/* AI Model Card Styling */
.ai-model {
    background: var(--gptd-dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-model.high .model-icon {
    background: var(--gptd-danger);
}

.ai-model.medium .model-icon {
    background: var(--gptd-warning);
}

.ai-model.low .model-icon {
    background: var(--gptd-success);
}

/* Desktop - Fit entire view within viewport */
@media (min-width: 1200px) {
    .gptdetector-wrapper {
        max-width: 900px;
        margin: 0 auto;
    }
    
    /* Reduce textarea height on desktop to fit everything */
    .gptdetector-input {
        height: 250px !important;
    }
}

@media (min-width: 1400px) {
    .gptdetector-wrapper {
        max-width: 1000px;
    }
    
    .gptdetector-input {
        height: 280px !important;
    }
}

@media (min-width: 1600px) {
    .gptdetector-wrapper {
        max-width: 1100px;
    }
    
    .gptdetector-input {
        height: 300px !important;
    }
}

/* For very large screens, scale down if needed to fit viewport */
@media (min-width: 1920px) and (min-height: 900px) {
    .gptdetector-wrapper {
        max-width: 1200px;
        transform: scale(0.95);
        transform-origin: top center;
    }
}

/* Compact view for screens with limited height */
@media (min-width: 1200px) and (max-height: 800px) {
    .gptdetector-wrapper {
        transform: scale(0.9);
        transform-origin: top center;
    }
    
    .gptdetector-input {
        height: 200px !important;
    }
    
    .gptdetector-source-options {
        padding: 1rem;
    }
}

@media (min-width: 1200px) and (max-height: 700px) {
    .gptdetector-wrapper {
        transform: scale(0.85);
        transform-origin: top center;
    }
    
    .gptdetector-input {
        height: 180px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gptdetector-wrapper {
        padding: 1rem;
    }
    
    /* On mobile, stack vertically */
    .gptdetector-score-models-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gptdetector-score-section,
    .gptdetector-models-section {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-width: auto;
    }
    
    .score-gauge-svg {
        max-width: 160px;
    }
    
    .score-section-title {
        font-size: 1.25rem;
    }
    
    /* Adjust tooltip position on mobile */
    .score-info-tooltip[data-tooltip]:hover::after,
    .interpretation-tooltip[data-tooltip]:hover::after {
        width: 250px;
        left: 0;
        transform: translateX(0);
    }
    
    .score-info-tooltip[data-tooltip]:hover::before,
    .interpretation-tooltip[data-tooltip]:hover::before {
        left: 20px;
        transform: translateX(0);
    }
    
    .models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-item.summary-card {
        grid-column: 1;
    }
    
    .score-gauge {
        width: 150px;
        height: 150px;
    }
    
    .score-value {
        font-size: 2rem;
    }
    
    .gptdetector-buttons {
        flex-direction: column;
    }
    
    .gptdetector-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Metric Improvements Styling */
.metric-improvements {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-improvements-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gptd-primary);
    margin-bottom: 0.5rem;
}

.metric-improvements ul {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.metric-improvements li {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
}

/* Improvement Prompt Styling */
.improvement-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.improvement-prompt-header h4 {
    margin: 0;
    color: var(--gptd-primary);
}

.copy-prompt-btn {
    padding: 0.5rem 1rem;
    background: var(--gptd-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.copy-prompt-btn:hover {
    background: var(--gptd-secondary);
}

.improvement-prompt-text {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Additional Score Section Styling for Better Layout */
.score-section-title {
    font-size: 1.1rem !important;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
    text-align: center;
}

.score-info-tooltip {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
}

.score-info-tooltip i {
    font-size: 1.1rem;
    color: var(--gptd-primary);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.score-info-tooltip:hover i,
.score-info-tooltip.tooltip-active i {
    opacity: 1;
    transform: scale(1.1);
}

/* Compact Score Statistics - Better Alignment */
.score-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    font-size: 0.85rem;
}

.score-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    order: 2;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gptd-primary);
    order: 1;
    line-height: 1;
}

/* Tooltip click functionality - Improved */
.score-info-tooltip,
.interpretation-tooltip {
    cursor: pointer !important;
}

.score-info-tooltip[data-tooltip]::after,
.interpretation-tooltip[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    width: 280px;
    z-index: 9999;
    pointer-events: none;
    text-align: left;
    font-weight: 400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.score-info-tooltip[data-tooltip]::before,
.interpretation-tooltip[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

/* Show on hover OR when active */
.score-info-tooltip[data-tooltip]:hover::after,
.score-info-tooltip.tooltip-active[data-tooltip]::after,
.interpretation-tooltip[data-tooltip]:hover::after,
.interpretation-tooltip.tooltip-active[data-tooltip]::after {
    opacity: 1;
    visibility: visible;
}

.score-info-tooltip[data-tooltip]:hover::before,
.score-info-tooltip.tooltip-active[data-tooltip]::before,
.interpretation-tooltip[data-tooltip]:hover::before,
.interpretation-tooltip.tooltip-active[data-tooltip]::before {
    opacity: 1;
    visibility: visible;
}

/* Compact layout without excess height */
.gptdetector-score-section {
    justify-content: flex-start !important;
}

.gptdetector-models-section {
    /* No overflow scrolling */
}

.models-container {
    min-width: 0;
    width: 100%;
}

.model-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.models-grid {
    min-width: 0;
}

/* Smart Responsive Design */
@media (max-width: 1200px) {
    .gptdetector-score-models-container {
        flex-wrap: wrap;
    }
    
    .gptdetector-score-section {
        flex: 1 1 100%;
        min-width: auto;
        margin-bottom: 1.5rem;
    }
    
    .gptdetector-models-section {
        flex: 1 1 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    /* Source Options - Stack on mobile */
    .gptdetector-source-options {
        padding: 15px;
    }
    
    .source-options-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .url-load-container {
        flex-wrap: wrap;
    }
    
    .gptdetector-url-input {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .gptdetector-btn-secondary,
    .gptdetector-btn-outline {
        width: 100%;
    }
    
    .file-upload-wrapper {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .file-info {
        text-align: center;
    }
    
    /* Compact Limits - Stack on mobile */
    .gptdetector-limits-info {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .limits-bars {
        flex-direction: column;
        gap: 10px;
    }
    
    .limit-bar {
        max-width: 100%;
    }
    
    .limits-footer {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .limits-role,
    .limits-reset {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* Stack all model groups vertically */
    .models-container {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .ai-models-group,
    .human-score-group {
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
    }
    
    /* Hide separator on mobile */
    .human-score-separator {
        display: none !important;
    }
    
    /* Convert ALL models to vertical list on mobile */
    .models-grid,
    #ai-models-grid,
    #human-model-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    
    /* Human section spacing */
    .human-score-group {
        margin-top: 1.5rem !important;
        padding-top: 1.5rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .model-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.75rem 1rem !important;
        flex-direction: row !important;
        width: 100% !important;
    }
    
    .model-item .model-icon {
        margin: 0 !important;
        font-size: 1.3rem !important;
    }
    
    .model-item .model-name {
        flex: 1;
        text-align: left !important;
        margin: 0 1rem;
    }
    
    .model-item .model-score {
        font-size: 1.1rem !important;
        margin-right: 1rem;
    }
    
    .model-item .model-bar {
        width: 80px !important;
        height: 6px !important;
    }
    
    /* Compact stats on mobile */
    .score-stats {
        gap: 1rem;
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
}
}

/* ========================================
   Restricted Features Styles - Simple Overlay
   ======================================== */

.feature-restricted {
    position: relative;
}

/* Keep the original content visible but blurred */
.feature-restricted-content {
    filter: blur(4px);
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
}

/* Simple semi-transparent overlay */
.feature-restricted-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 280px;
    max-width: 90%;
}

.feature-restricted-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gptd-text-primary);
    margin: 0 0 8px 0;
}

.feature-restricted-description {
    font-size: 0.9rem;
    color: var(--gptd-text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.feature-upgrade-btn {
    padding: 8px 24px;
    background: linear-gradient(135deg, var(--gptd-primary) 0%, var(--gptd-secondary) 100%);
    color: var(--gptd-dark);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.feature-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.4);
}

/* Sentence Analysis Restricted */
.gptdetector-sentences-section.feature-restricted .sentences-list {
    min-height: 200px;
    position: relative;
}

/* Summary Card Restricted */
.metric-item.summary-card.feature-restricted {
    position: relative;
}

.summary-card.feature-restricted .improvement-prompt {
    position: relative;
}

.summary-card.feature-restricted .improvement-prompt-text {
    min-height: 120px;
}

/* Fake blurred content for restricted features */
.fake-sentence-content {
    padding: 20px;
    line-height: 1.8;
    color: var(--gptd-gray-light);
}

.fake-sentence {
    display: inline;
    padding: 3px 6px;
    margin: 0 3px;
    border-radius: 4px;
    font-size: 0.95rem;
}

.fake-sentence.ai-high {
    background: rgba(255, 56, 56, 0.15);
    color: var(--gptd-danger);
    border: 1px solid rgba(255, 56, 56, 0.3);
}

.fake-sentence.ai-medium {
    background: rgba(255, 184, 0, 0.15);
    color: var(--gptd-warning);
    border: 1px solid rgba(255, 184, 0, 0.3);
}

.fake-sentence.ai-low {
    background: rgba(0, 245, 160, 0.15);
    color: var(--gptd-success);
    border: 1px solid rgba(0, 245, 160, 0.3);
}

.fake-tips-content {
    padding: 15px;
}

.fake-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.15);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.fake-tip-icon {
    color: var(--gptd-primary);
    font-size: 1.1rem;
    margin-top: 2px;
}

.fake-tip-text {
    flex: 1;
    color: var(--gptd-gray-light);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .feature-restricted-overlay {
        padding: 20px;
        gap: 12px;
    }
    
    .feature-restricted-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .feature-restricted-title {
        font-size: 1.1rem;
    }
    
    .feature-restricted-description {
        font-size: 0.9rem;
    }
    
    .feature-upgrade-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}

/* ========================= */
/* History Sidebar Styles    */
/* ========================= */

/* History Button */
#gptdetector-history-btn {
    position: relative;
}

.history-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--gptd-danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Sidebar Container */
.gptdetector-history-sidebar {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: -380px;
    width: 380px;
    max-height: 85vh;
    height: auto;
    background: var(--gptd-dark);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    border-radius: 0 12px 12px 0;
    overflow: hidden;
}

.gptdetector-history-sidebar.collapsed {
    left: -330px !important; /* Show only 50px for expand button */
}

.gptdetector-history-sidebar.collapsed .history-close-btn i {
    transform: rotate(180deg);
}

/* Custom Scrollbar for History Sidebar */
.gptdetector-history-sidebar ::-webkit-scrollbar {
    width: 8px;
}

.gptdetector-history-sidebar ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.gptdetector-history-sidebar ::-webkit-scrollbar-thumb {
    background: var(--gptd-primary);
    border-radius: 4px;
    opacity: 0.7;
}

.gptdetector-history-sidebar ::-webkit-scrollbar-thumb:hover {
    background: var(--gptd-primary);
    opacity: 1;
}

/* Firefox scrollbar */
.gptdetector-history-sidebar * {
    scrollbar-width: thin;
    scrollbar-color: var(--gptd-primary) rgba(255, 255, 255, 0.05);
}

.gptdetector-history-sidebar.active {
    left: 20px !important;
    display: flex !important;
}

/* Sidebar Header */
.history-sidebar-header {
    background: var(--gptd-dark-light);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-sidebar-header h3 {
    color: var(--gptd-white);
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.history-close-btn {
    background: transparent;
    border: none;
    color: var(--gptd-gray-light);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.history-close-btn:hover {
    color: var(--gptd-white);
}

/* User Info Section */
.history-user-info {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-logged-in,
.user-guest {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gptd-gray-light);
    font-size: 14px;
}

.user-logged-in i,
.user-guest i {
    font-size: 20px;
    color: var(--gptd-primary);
}

.login-link {
    display: block;
    margin-top: 8px;
    color: var(--gptd-primary);
    text-decoration: none;
    font-size: 13px;
    transition: opacity 0.2s;
}

.login-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Search Section */
.history-search {
    padding: 16px 20px;
    position: relative;
}

#history-search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    background: var(--gptd-dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--gptd-white);
    font-size: 14px;
    transition: border-color 0.2s;
}

#history-search-input:focus {
    outline: none;
    border-color: var(--gptd-primary);
}

#history-search-input::placeholder {
    color: var(--gptd-gray-light);
    opacity: 0.6;
}

.history-search i {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gptd-gray-light);
    pointer-events: none;
}

/* History Content */
.history-sidebar-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* History List */
.history-list {
    padding: 12px;
}

/* History Item */
.history-item {
    background: var(--gptd-dark-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    background: rgba(0, 217, 255, 0.05);
    border-color: rgba(0, 217, 255, 0.2);
    transform: translateX(-4px);
}

.history-item.active {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--gptd-primary);
}

/* History Item Header */
.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.history-item-title {
    color: var(--gptd-white);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-title.editing {
    background: transparent;
    border: 1px solid var(--gptd-primary);
    padding: 2px 6px;
    border-radius: 4px;
    outline: none;
    white-space: normal;
}

.history-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.history-action-btn {
    background: transparent;
    border: none;
    color: var(--gptd-gray-light);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.2s;
}

.history-action-btn:hover {
    color: var(--gptd-white);
}

.history-action-btn.delete:hover {
    color: var(--gptd-danger);
}

/* History Item Meta */
.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--gptd-gray-light);
}

.history-item-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-item-score {
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

.score-badge.ai {
    background: rgba(255, 56, 56, 0.2);
    color: var(--gptd-danger);
}

.score-badge.mixed {
    background: rgba(255, 184, 0, 0.2);
    color: var(--gptd-warning);
}

.score-badge.human {
    background: rgba(0, 245, 160, 0.2);
    color: var(--gptd-success);
}

/* History Item Preview */
.history-item-preview {
    color: var(--gptd-text-secondary);
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    opacity: 0.8;
}

/* Empty State */
.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gptd-gray-light);
}

.history-empty i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.history-empty p {
    margin: 8px 0;
    font-size: 16px;
}

.history-empty small {
    font-size: 13px;
    opacity: 0.6;
}

/* Loading State */
.history-loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner-border {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gptd-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Sidebar Footer */
.history-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--gptd-dark-light);
}

.clear-history-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(255, 56, 56, 0.3);
    color: var(--gptd-danger);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-history-btn:hover {
    background: rgba(255, 56, 56, 0.1);
    border-color: var(--gptd-danger);
}

/* Overlay */
.history-overlay {
    display: none !important; /* Completely hide overlay - no dimming */
    /* Original styles commented out - no longer using dimming effect
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    */
}

/* Disabled - no overlay needed
.history-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
*/

/* Read-only mode indicator */
.gptdetector-wrapper.read-only {
    position: relative;
}

.read-only-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 184, 0, 0.1);
    color: var(--gptd-warning);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 184, 0, 0.2);
}

.read-only-badge i {
    font-size: 14px;
}

.close-history-view {
    background: transparent;
    border: none;
    color: var(--gptd-warning);
    cursor: pointer;
    padding: 0 4px;
    margin-left: 8px;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-history-view:hover {
    opacity: 1;
}

/* Notebook Page Style for History View */
.gptdetector-wrapper.history-view {
    position: relative;
    background: transparent;
}

/* History Preview - EXACT copy with notebook styling overlay */
#gptdetector-history-preview.notebook-view {
    position: relative;
    /* Add subtle notebook paper background */
    background-image: 
        linear-gradient(90deg, transparent 0, transparent 60px, #ff6b6b 60px, #ff6b6b 62px, transparent 62px),
        repeating-linear-gradient(
            transparent,
            transparent 27px,
            #e0e0e0 27px,
            #e0e0e0 28px
        );
    background-color: #fafafa;
    padding-left: 20px;
}

/* Dark theme notebook view */
body.dark-mode #gptdetector-history-preview.notebook-view,
.dark-theme #gptdetector-history-preview.notebook-view {
    background-image: 
        linear-gradient(90deg, transparent 0, transparent 60px, #8b4444 60px, #8b4444 62px, transparent 62px),
        repeating-linear-gradient(
            transparent,
            transparent 27px,
            #3a3a3a 27px,
            #3a3a3a 28px
        );
    background-color: var(--gptd-dark-bg);
}

/* Notebook header overlay - high contrast */
.notebook-overlay-header {
    background: linear-gradient(135deg, var(--gptd-bg-secondary) 0%, var(--gptd-bg-tertiary) 100%);
    color: var(--gptd-text-primary);
    padding: 15px 20px;
    margin: -20px -20px 20px -20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 10;
    border-bottom: 2px solid var(--gptd-border-color);
}

/* Dark theme header */
body.dark-mode .notebook-overlay-header,
.dark-theme .notebook-overlay-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 2px solid var(--gptd-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.notebook-overlay-header .notebook-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.9;
}

.notebook-overlay-header .notebook-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin: 0 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notebook-overlay-header .notebook-close {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--gptd-white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.notebook-overlay-header .notebook-close:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

/* Make the textarea look more notebook-like */
#gptdetector-history-preview .gptdetector-input {
    background: transparent !important;
    line-height: 28px !important;
}

/* Hide the word counter in history view */
#gptdetector-history-preview .gptdetector-word-counter {
    display: none;
}

/* Cleaned up - removed old notebook bloat */
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 40px rgba(255, 255, 255, 0.05);
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    background-image: 
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 39px,
            rgba(200, 200, 200, 0.1) 39px,
            rgba(200, 200, 200, 0.1) 40px
        );
}

.notebook-header {
    background: var(--gptd-dark);
    border-bottom: 2px solid var(--gptd-primary);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--gptd-white);
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.notebook-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), transparent);
}

.notebook-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.95;
    color: var(--gptd-text-primary);
}

.notebook-date i {
    font-size: 16px;
}

.notebook-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    color: var(--gptd-text-primary);
    text-align: center;
    padding: 0 20px;
}

.notebook-header .close-history-view {
    background: var(--gptd-primary);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.notebook-header .close-history-view:hover {
    background: var(--gptd-danger);
    transform: rotate(90deg);
    opacity: 1;
}

/* Style the content inside notebook page */
.history-view .gptdetector-container {
    padding: 0 30px 30px;
}

/* Custom scrollbar for history view */
.history-view ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.history-view ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.history-view ::-webkit-scrollbar-thumb {
    background: var(--gptd-primary);
    border-radius: 5px;
    opacity: 0.8;
}

.history-view ::-webkit-scrollbar-thumb:hover {
    background: var(--gptd-primary);
    opacity: 1;
}

/* Firefox scrollbar for history view */
.history-view * {
    scrollbar-width: thin;
    scrollbar-color: var(--gptd-primary) rgba(0, 0, 0, 0.1);
}

.history-view .gptdetector-input {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(200, 200, 200, 0.3);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.history-view .gptdetector-results {
    background: transparent;
}

.history-view .result-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Add paper texture effect */
.notebook-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 60px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(255, 100, 100, 0.2) 10%, 
        rgba(255, 100, 100, 0.2) 90%, 
        transparent 100%);
}

/* Spiral binding effect */
.notebook-page::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 30px;
    bottom: 20px;
    width: 20px;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 8px,
        #888 8px,
        #888 10px,
        transparent 10px,
        transparent 20px
    );
    opacity: 0.3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gptdetector-history-sidebar {
        width: 100%;
        left: -100%;
        top: 0;
        transform: none;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .gptdetector-history-sidebar.active {
        left: 0 !important;
    }
    
    .gptdetector-history-sidebar.collapsed {
        left: -100% !important;
    }
    
    .notebook-page-wrapper {
        padding: 15px 10px;
    }
    
    .notebook-page {
        border-radius: 8px;
    }
    
    .notebook-header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .notebook-title {
        width: 100%;
        margin-top: 10px;
        font-size: 16px;
    }
    
    .notebook-date {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .history-sidebar-header h3 {
        font-size: 16px;
    }
    
    .history-item-title {
        font-size: 13px;
    }
    
    .history-item-preview {
        font-size: 12px;
    }
}

/* ===================================
   Light Mode Styles for History Sidebar
   =================================== */

/* Main sidebar container in light mode - only shadow adjustment needed */
:root[data-theme="light"] .gptdetector-history-sidebar,
html[data-theme="light"] .gptdetector-history-sidebar {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

/* Remove redundant light mode overrides - handled by CSS variables */

body.light-mode .history-count,
body[data-theme="light"] .history-count {
    background: #4CAF50;
    color: white;
}


/* History items hover in light mode */
:root[data-theme="light"] .history-item:hover,
html[data-theme="light"] .history-item:hover {
    background: var(--gptd-bg-primary);
    border-color: var(--gptd-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Text colors handled by CSS variables */

/* History item icons in light mode */
body.light-mode .history-item-actions i,
body[data-theme="light"] .history-item-actions i {
    color: #666;
}

body.light-mode .history-item-actions i:hover,
body[data-theme="light"] .history-item-actions i:hover {
    color: var(--gptd-primary);
}

/* Close button in light mode */
body.light-mode .history-close-btn,
body[data-theme="light"] .history-close-btn {
    background: var(--gptd-primary);
    color: white;
}

body.light-mode .history-close-btn:hover,
body[data-theme="light"] .history-close-btn:hover {
    background: #0056b3;
}


body.light-mode .history-clear-btn,
body[data-theme="light"] .history-clear-btn {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}

body.light-mode .history-clear-btn:hover,
body[data-theme="light"] .history-clear-btn:hover {
    background: #dc3545;
    color: white;
}

/* Notebook overlay in light mode */
body.light-mode .notebook-overlay,
body[data-theme="light"] .notebook-overlay {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .notebook-page-wrapper,
body[data-theme="light"] .notebook-page-wrapper {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Notebook overlay header light mode adjustments */
:root[data-theme="light"] .notebook-overlay-header,
html[data-theme="light"] .notebook-overlay-header {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.light-mode .notebook-title-edit,
body[data-theme="light"] .notebook-title-edit {
    background: #f8f9fa;
    color: #1a1a2e;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .notebook-title-edit:focus,
body[data-theme="light"] .notebook-title-edit:focus {
    background: white;
    border-color: var(--gptd-primary);
}

body.light-mode .notebook-back-btn,
body[data-theme="light"] .notebook-back-btn {
    background: var(--gptd-primary);
    color: white;
}

body.light-mode .notebook-back-btn:hover,
body[data-theme="light"] .notebook-back-btn:hover {
    background: #0056b3;
}

/* Feature restricted overlay in light mode */
/* Feature restricted overlay light mode adjustments */
:root[data-theme="light"] .feature-restricted-overlay,
html[data-theme="light"] .feature-restricted-overlay {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Feature upgrade button in light mode - ensure visibility */
:root[data-theme="light"] .feature-upgrade-btn,
html[data-theme="light"] .feature-upgrade-btn {
    color: #ffffff;
    background: linear-gradient(135deg, var(--gptd-primary) 0%, #0056b3 100%);
}

:root[data-theme="light"] .feature-upgrade-btn:hover,
html[data-theme="light"] .feature-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Remove redundant overrides - handled by CSS variables */

body.light-mode .unlock-button,
body[data-theme="light"] .unlock-button {
    background: linear-gradient(135deg, var(--gptd-primary) 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

body.light-mode .unlock-button:hover,
body[data-theme="light"] .unlock-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* Scrollbar in light mode */
body.light-mode .gptdetector-history-sidebar ::-webkit-scrollbar-track,
body[data-theme="light"] .gptdetector-history-sidebar ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .gptdetector-history-sidebar ::-webkit-scrollbar-thumb,
body[data-theme="light"] .gptdetector-history-sidebar ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

body.light-mode .gptdetector-history-sidebar ::-webkit-scrollbar-thumb:hover,
body[data-theme="light"] .gptdetector-history-sidebar ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Loading states in light mode */
body.light-mode .history-loading,
body[data-theme="light"] .history-loading {
    color: #666;
}

body.light-mode .spinner-border,
body[data-theme="light"] .spinner-border {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--gptd-primary);
}

/* Empty state in light mode */
body.light-mode .history-empty,
body[data-theme="light"] .history-empty {
    color: #999;
}

/* User info section handled by CSS variables */

body.light-mode .login-link,
body[data-theme="light"] .login-link {
    color: var(--gptd-primary) !important;
}

/* Search input colors handled by CSS variables */

/* Score badges in light mode */
body.light-mode .score-badge,
body[data-theme="light"] .score-badge {
    background: rgba(0, 0, 0, 0.08) !important;
    color: #333 !important;
}

body.light-mode .score-badge.ai,
body[data-theme="light"] .score-badge.ai {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

body.light-mode .score-badge.human,
body[data-theme="light"] .score-badge.human {
    background: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
}

/* ===================================
   Floating History Launcher Button
   =================================== */

.history-launcher-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gptd-primary) 0%, #0056b3 100%);
    border: none;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.history-launcher-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.history-launcher-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 123, 255, 0.4);
}

.history-launcher-btn:active {
    transform: scale(0.95);
}

/* Badge on launcher */
.history-launcher-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.history-launcher-badge:empty,
.history-launcher-badge[style*="display: none"] {
    display: none !important;
}

/* Light mode launcher button */
body.light-mode .history-launcher-btn,
body[data-theme="light"] .history-launcher-btn {
    background: linear-gradient(135deg, var(--gptd-primary) 0%, #0056b3 100%);
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.25);
}

body.light-mode .history-launcher-btn:hover,
body[data-theme="light"] .history-launcher-btn:hover {
    box-shadow: 0 6px 30px rgba(0, 123, 255, 0.35);
}

/* Minimize button styles */
.history-minimize-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.history-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Light mode minimize button */
body.light-mode .history-minimize-btn,
body[data-theme="light"] .history-minimize-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

body.light-mode .history-minimize-btn:hover,
body[data-theme="light"] .history-minimize-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Hide launcher when sidebar is active */
.gptdetector-history-sidebar.active ~ .history-launcher-btn {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .history-launcher-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .history-launcher-badge {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: -3px;
        right: -3px;
    }
}
