/* AI Content Detector - Custom CSS Styles */

/* Toggle Switch Component */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #cbd5e0;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-switch:hover {
    background-color: #a0aec0;
}

input:checked + .toggle-switch {
    background-color: #4299e1;
}

input:checked + .toggle-switch:hover {
    background-color: #3182ce;
}

.toggle-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .toggle-switch .toggle-dot {
    transform: translateX(20px);
}

/* Analysis Tab Styling */
.analysis-tab {
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.analysis-tab:hover:not(.active) {
    color: #4a5568 !important;
    border-bottom-color: #cbd5e0 !important;
}

.analysis-tab.active {
    position: relative;
}

.analysis-tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3182ce, #805ad5);
    border-radius: 1px;
}

/* Custom Scrollbar for Tab Content */
.max-h-48::-webkit-scrollbar {
    width: 6px;
}

.max-h-48::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.max-h-48::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.max-h-48::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Confidence Bar Animation */
@keyframes confidenceBarGlow {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
    }
}

#confidenceBar {
    animation: confidenceBarGlow 2s infinite;
    background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444) !important;
}

/* Input Focus Effects */
#inputText:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Button Hover Effects */
.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Gradient Text Effects */
.bg-clip-text {
    -webkit-background-clip: text;
    background-clip: text;
}

.text-transparent {
    color: transparent;
}

/* Card Hover Effects */
.bg-white:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Results Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#resultsContent {
    animation: slideInUp 0.5s ease-out;
}

/* Score Bar Animation */
@keyframes scoreBarFill {
    from {
        width: 0%;
    }
}

.h-2 {
    animation: scoreBarFill 1s ease-out;
}

/* Toast Animation */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#successToast {
    animation: toastSlideIn 0.3s ease-out;
}

/* Tab Content Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#tabContent {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .text-4xl.md\:text-6xl {
        font-size: 2.5rem;
    }

    .text-xl.md\:text-2xl {
        font-size: 1.25rem;
    }

    .max-w-7xl {
        max-width: 100%;
        padding: 0 1rem;
    }

    .analysis-tab {
        font-size: 0.875rem;
        padding: 0.5rem 0.25rem;
    }

    .grid.sm\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .grid.sm\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .flex-wrap.gap-3 {
        flex-direction: column;
    }

    .flex-wrap.gap-3 button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .px-4.sm\:px-6.lg\:px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .h-64 {
        height: 12rem;
    }

    .text-2xl {
        font-size: 1.5rem;
    }

    .text-lg {
        font-size: 1.125rem;
    }

    .p-6 {
        padding: 1rem;
    }

    .p-8 {
        padding: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .fixed,
    button,
    .bg-gradient-to-r,
    .shadow-xl,
    .shadow-lg {
        display: none !important;
    }

    .bg-white {
        background: white !important;
        color: black !important;
    }

    .text-white {
        color: black !important;
    }

    .rounded-2xl,
    .rounded-xl,
    .rounded-lg {
        border: 1px solid #cbd5e0 !important;
        border-radius: 0 !important;
    }

    .grid {
        display: block !important;
    }

    .grid > * {
        margin-bottom: 1rem;
        break-inside: avoid;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .border-gray-100,
    .border-gray-200 {
        border-color: #000 !important;
        border-width: 2px !important;
    }

    .text-gray-500,
    .text-gray-600 {
        color: #000 !important;
    }

    .bg-gray-50,
    .bg-gray-100 {
        background-color: #fff !important;
        border: 2px solid #000 !important;
    }
}

/* Focus Indicators for Accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

/* Smooth Transitions */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

/* Custom Utility Classes */
.border-3 {
    border-width: 3px;
}

.text-balance {
    text-wrap: balance;
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

/* Loading Spinner Enhancement */
.animate-spin {
    border-style: solid;
    border-color: transparent transparent #3182ce #3182ce;
}

/* Custom Grid for Better Mobile Layout */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Enhanced Shadow Effects */
.shadow-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.shadow-glow-purple {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Typography Enhancements */
.font-display {
    font-display: swap;
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.transform-gpu {
    transform: translateZ(0);
}
