/* Plagiarism Checker 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);
}

#includeCitations:checked + .toggle-switch,
#deepAnalysis:checked + .toggle-switch {
    background: #dc2626;
}

#includeCitations:checked + .toggle-switch:hover,
#deepAnalysis:checked + .toggle-switch:hover {
    background: #b91c1c;
}

#includeCitations:checked + .toggle-switch .toggle-dot,
#deepAnalysis:checked + .toggle-switch .toggle-dot {
    transform: translateX(24px);
}

/* Analysis Tab Styles */
.analysis-tab {
    border: 1px solid transparent;
    position: relative;
}

.analysis-tab.active {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
}

.analysis-tab:not(.active):hover {
    background: #f3f4f6;
    color: #374151;
}

/* Progress Animation */
.progress-step {
    opacity: 0.5;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.progress-step.active {
    opacity: 1;
    transform: scale(1);
    color: #dc2626;
}

/* Plagiarism Score Ring */
.plagiarism-ring {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(from 0deg, #dc2626 0%, #ea580c 50%, #10b981 100%);
    margin: 0 auto 1rem;
}

.plagiarism-ring::before {
    content: "";
    position: absolute;
    inset: 8px;
    background: white;
    border-radius: 50%;
}

.plagiarism-ring .score {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

/* Duplicate Text Highlighting */
.text-highlight {
    position: relative;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.text-highlight.high-similarity {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.text-highlight.medium-similarity {
    background: rgba(234, 88, 12, 0.2);
    border: 1px solid rgba(234, 88, 12, 0.3);
}

.text-highlight.low-similarity {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.text-highlight:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Source Card Styles */
.source-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    background: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.source-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #dc2626, #ea580c);
}

.source-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #fca5a5;
}

.source-card .similarity-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.source-card .similarity-badge.high {
    background: #dc2626;
}

.source-card .similarity-badge.medium {
    background: #ea580c;
}

.source-card .similarity-badge.low {
    background: #f59e0b;
}

/* Sentence Analysis */
.sentence-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: white;
    transition: all 0.2s ease;
}

.sentence-item:hover {
    border-color: #fca5a5;
    background: #fef2f2;
}

.sentence-item.plagiarized {
    border-left: 4px solid #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.sentence-item.suspicious {
    border-left: 4px solid #ea580c;
    background: rgba(234, 88, 12, 0.05);
}

.sentence-item.original {
    border-left: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.05);
}

/* Statistics Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #dc2626, #ea580c, #f59e0b);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Recommendation Cards */
.recommendation-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
    border: 1px solid #fca5a5;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.recommendation-card::before {
    content: "💡";
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.25rem;
}

.recommendation-card h4 {
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.recommendation-card p {
    color: #7c2d12;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Loading Animation */
@keyframes pulse-red {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse-red 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Export Section */
.export-section {
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
    border: 1px solid #fca5a5;
    border-radius: 16px;
    padding: 2rem;
}

.export-section h3 {
    background: linear-gradient(135deg, #dc2626, #ea580c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.75rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Search Engine Icons */
.search-engine-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.search-engine-icon.google {
    background: linear-gradient(45deg, #4285f4, #ea4335, #fbbc05, #34a853);
}

.search-engine-icon.bing {
    background: linear-gradient(45deg, #00809d, #0078d4);
}

.search-engine-icon.duckduckgo {
    background: linear-gradient(45deg, #de5833, #f4b942);
}

/* Similarity Meter */
.similarity-meter {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.similarity-meter .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
    background: linear-gradient(to right, #10b981, #f59e0b, #ea580c, #dc2626);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .plagiarism-ring {
        width: 100px;
        height: 100px;
    }

    .plagiarism-ring .score {
        font-size: 1.25rem;
    }

    .source-card .similarity-badge {
        position: static;
        margin-top: 0.5rem;
        display: inline-block;
    }

    .analysis-tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Print Styles */
@media print {
    .export-section,
    #exportSection,
    .toggle-switch,
    button {
        display: none !important;
    }

    .source-card,
    .sentence-item,
    .recommendation-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .text-highlight {
        background: transparent !important;
        border: 1px solid #000 !important;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.analysis-tab:focus,
button:focus,
select:focus,
textarea:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .text-highlight.high-similarity {
        background: #000;
        color: #fff;
    }

    .text-highlight.medium-similarity {
        background: #666;
        color: #fff;
    }

    .text-highlight.low-similarity {
        background: #999;
        color: #fff;
    }
}
