/* ChatGPT Detector Tool Styles */

/* Toggle Switch Component */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-switch:hover {
    background: #d1d5db;
}

.toggle-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#realTimeAnalysis:checked + .toggle-switch {
    background: #10b981;
}

#realTimeAnalysis:checked + .toggle-switch:hover {
    background: #059669;
}

#realTimeAnalysis:checked + .toggle-switch .toggle-dot {
    transform: translateX(24px);
}

/* Analysis Tab Styles */
.analysis-tab {
    border: 1px solid transparent;
    position: relative;
}

.analysis-tab.active {
    background: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #10b981;
}

.analysis-tab:not(.active):hover {
    background: #f3f4f6;
    color: #374151;
}

/* Confidence Bar Animation */
.confidence-bar {
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
    transition: width 1s ease-out;
}

/* Loading Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Result Cards */
.result-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.result-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.result-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.result-card-score {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.result-card-content {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* Progress Indicators */
.progress-indicator {
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-bar.high {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.progress-bar.medium {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-bar.low {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* Badge Styles */
.detection-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.detection-badge.very-likely {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.detection-badge.likely {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.detection-badge.possible {
    background: #fef7cd;
    color: #a16207;
    border: 1px solid #fed7aa;
}

.detection-badge.unlikely {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.detection-badge.very-unlikely {
    background: #f0fdf4;
    color: #14532d;
    border: 1px solid #86efac;
}

/* Model Likelihood Chart */
.model-likelihood {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-item {
    display: flex;
    align-items: center;
    justify-content: between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.model-name {
    font-weight: 500;
    color: #374151;
    flex: 1;
}

.model-percentage {
    font-weight: 600;
    color: #1f2937;
    margin-left: 12px;
    min-width: 40px;
    text-align: right;
}

.model-bar {
    flex: 2;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin: 0 12px;
}

.model-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.model-bar-fill.gpt4 {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.model-bar-fill.gpt35 {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.model-bar-fill.gpt3 {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* Signature List */
.signature-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.signature-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 14px;
}

.signature-phrase {
    color: #374151;
    font-weight: 500;
}

.signature-count {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Human Traits Indicators */
.human-trait {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.human-trait:last-child {
    border-bottom: none;
}

.human-trait-name {
    color: #374151;
    font-weight: 500;
}

.human-trait-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trait-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.trait-indicator.present {
    background: #10b981;
}

.trait-indicator.absent {
    background: #e5e7eb;
}

/* Export Buttons Hover Effects */
.export-button {
    transition: all 0.3s ease;
}

.export-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Toast Notification */
#successToast {
    min-width: 300px;
    max-width: 400px;
}

#successToast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analysis-tab {
        flex: 1;
        min-width: 0;
        text-align: center;
    }

    .result-card {
        padding: 16px;
    }

    .model-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .model-name,
    .model-percentage {
        text-align: center;
    }

    .model-bar {
        margin: 0;
    }
}

@media (max-width: 640px) {
    .detection-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .signature-item {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .signature-count {
        align-self: flex-start;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus States */
button:focus,
select:focus,
textarea:focus {
    outline: none;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Custom Select Dropdown */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 32px;
}

/* Utility Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .toggle-switch {
        border: 2px solid currentColor;
    }

    .analysis-tab.active {
        border-width: 2px;
    }

    .result-card {
        border-width: 2px;
    }
}
