/* Modern AI Detector CSS - CinePrompt Style */

.ai-detector-pro {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: radial-gradient(ellipse at top, #1e1b4b 0%, #0f0f23 100%);
    border-radius: 12px;
    min-height: 90vh;
    position: relative;
    overflow: hidden;
}

/* Header Section - CinePrompt Style */
.detector-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    color: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(139, 92, 246, 0.5);
    position: relative;
    overflow: hidden;
}

.detector-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="20" cy="20" r="0.5" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="0.3" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="0.4" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    animation: float 25s infinite linear;
    z-index: 1;
}

@keyframes float {
    0% { transform: translateY(0px) translateX(0px); }
    100% { transform: translateY(-100px) translateX(-100px); }
}

.detector-header > * {
    position: relative;
    z-index: 2;
}

.detector-header h2 {
    margin: 0 0 15px 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: #FFFFFF !important;
}

.detector-description {
    margin: 0;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.9;
    font-weight: 400;
}

/* Form Section - Modern Style */
.detector-form-section {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 30px;
    padding: 1.25rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #8b5cf6 50%, transparent 100%);
    border-radius: 12px 12px 0 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #f1f5f9;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: #ef4444;
    margin-left: 4px;
}

/* Enhanced Input Styling - Better Visibility */
.analysis-textarea,
.context-textarea,
.styled-select {
    width: 100%;
    padding: 16px 20px;
    margin: 0.5rem 0;
    background: #0f172a !important; /* Deep navy background */
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    color: #e2e8f0 !important; /* Light text color */
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.analysis-textarea {
    min-height: 160px;
    resize: vertical;
    line-height: 1.6;
}

.context-textarea {
    min-height: 80px;
    resize: vertical;
}

.analysis-textarea:focus,
.context-textarea:focus,
.styled-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(15, 23, 42, 0.9) !important;
    color: #f8fafc !important;
}

.analysis-textarea::placeholder,
.context-textarea::placeholder {
    color: #64748b;
}

/* Enhanced Select Dropdown - Better Visibility */
.styled-select {
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238b5cf6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    appearance: none;
}

.styled-select option {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    padding: 10px;
}

/* Text Statistics */
.text-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #cbd5e1;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.min-length-indicator {
    font-weight: 600;
}

.min-length-indicator.insufficient {
    color: #ef4444;
}

.min-length-indicator.minimum {
    color: #f59e0b;
}

.min-length-indicator.sufficient {
    color: #10b981;
}

/* Help Text */
.help-text {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Enhanced Detect Button */
.detect-button {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.detect-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.5);
}

.detect-button:disabled {
    background: #475569;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Results Section */
.results-section {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-left: 5px solid #8b5cf6;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.results-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.confidence-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid;
}

.confidence-badge.high-confidence {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: #22c55e;
}

.confidence-badge.medium-confidence {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border-color: #f59e0b;
}

.confidence-badge.low-confidence {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: #ef4444;
}

/* Detection Cards */
.detection-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.result-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card.dominant {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.result-card.low-probability {
    opacity: 0.7;
    transform: scale(0.98);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.card-icon {
    font-size: 1.5rem;
}

.card-title {
    font-weight: 700;
    color: #f1f5f9;
    font-size: 1.1rem;
}

.probability-display {
    text-align: center;
}

.probability-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 10px;
}

.probability-bar {
    height: 8px;
    background: rgba(71, 85, 105, 0.5);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.probability-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
    position: relative;
}

.ai-fill {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.human-fill {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Detailed Analysis */
.detailed-analysis {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.detailed-analysis h4 {
    margin: 0 0 20px 0;
    color: #f1f5f9;
    font-weight: 700;
    font-size: 1.25rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.metric-label {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.9rem;
}

.metric-value {
    font-weight: 700;
    color: #f1f5f9;
    font-size: 1rem;
}

.reasoning-section {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #3b82f6;
}

.reasoning-section h5 {
    margin: 0 0 12px 0;
    color: #f1f5f9;
    font-weight: 700;
}

.reasoning-text {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.6;
    font-size: 0.95rem;
}

.indicators-section {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #f59e0b;
}

.indicators-section h5 {
    margin: 0 0 12px 0;
    color: #f1f5f9;
    font-weight: 700;
}

.indicators-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.indicator-tag {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Sentence Analysis */
.sentence-analysis {
    background: rgba(30, 41, 59, 0.3);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.sentence-analysis h4 {
    margin: 0 0 20px 0;
    color: #f1f5f9;
    font-weight: 700;
    font-size: 1.25rem;
}

.sentences-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sentence-item {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 15px;
    border-left: 4px solid rgba(148, 163, 184, 0.2);
    transition: all 0.3s ease;
}

.sentence-item.high-ai {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.sentence-item.medium-ai {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.sentence-item.low-ai {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.sentence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sentence-number {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.85rem;
}

.sentence-score {
    font-weight: 700;
    font-size: 0.85rem;
}

.sentence-item.high-ai .sentence-score {
    color: #fca5a5;
}

.sentence-item.medium-ai .sentence-score {
    color: #fbbf24;
}

.sentence-item.low-ai .sentence-score {
    color: #6ee7b7;
}

.sentence-text {
    color: #cbd5e1;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Action Buttons */
.results-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copy-btn,
.download-btn {
    background: rgba(71, 85, 105, 0.5);
    color: #cbd5e1;
    border: 2px solid rgba(148, 163, 184, 0.2);
}

.copy-btn:hover,
.download-btn:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: #8b5cf6;
    transform: translateY(-1px);
}

.outline-btn {
    background: transparent;
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
}

.outline-btn:hover {
    background: #8b5cf6;
    color: white;
}

.action-btn.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* Loading Section */
.loading-section {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
}

.loading-content {
    max-width: 500px;
    margin: 0 auto;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(71, 85, 105, 0.5);
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-title {
    margin: 0 0 10px 0;
    color: #f1f5f9;
    font-weight: 700;
    font-size: 1.25rem;
}

#loading-message {
    margin: 0 0 30px 0;
    color: #94a3b8;
    font-size: 1rem;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.step {
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    border-left: 4px solid rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.step.active {
    background: rgba(245, 158, 11, 0.2);
    border-left-color: #f59e0b;
    color: #fbbf24;
    font-weight: 600;
}

.step.completed {
    background: rgba(16, 185, 129, 0.2);
    border-left-color: #10b981;
    color: #6ee7b7;
    font-weight: 600;
}

.step.completed::before {
    content: '✅ ';
}

/* Error Section */
.error-section {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-text {
    flex: 1;
}

.error-text h4 {
    margin: 0 0 8px 0;
    color: #fca5a5;
    font-weight: 700;
}

.error-text p {
    margin: 0;
    color: #fecaca;
}

/* How It Works Section */
.how-it-works {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(71, 85, 105, 0.3) 100%);
    border-radius: 20px;
    padding: 40px;
    margin-top: 40px;
}

.how-it-works h3 {
    text-align: center;
    margin: 0 0 30px 0;
    color: #f1f5f9;
    font-weight: 700;
    font-size: 1.5rem;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.process-step {
    background: rgba(15, 23, 42, 0.6);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.process-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.2);
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0 auto 15px;
}

.process-step h4 {
    margin: 0 0 10px 0;
    color: #f1f5f9;
    font-weight: 700;
    font-size: 1.1rem;
}

.process-step p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Sample Text Buttons */
.sample-texts {
    margin: 15px 0;
}

.sample-btn {
    margin: 3px;
    padding: 5px 10px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #c4b5fd;
}

.sample-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
    color: #ddd6fe;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ai-detector-pro {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .detector-form-section,
    .results-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .ai-detector-pro {
        padding: 15px;
        margin: 0 -20px;
        border-radius: 0;
    }
    
    .detector-header {
        padding: 30px 20px;
    }
    
    .detector-header h2 {
        font-size: 2rem;
    }
    
    .detector-form-section,
    .results-section {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detection-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .process-steps {
        grid-template-columns: 1fr;
    }
    
    .loading-steps {
        gap: 8px;
    }
    
    .step {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .text-stats {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .detector-header h2 {
        font-size: 1.75rem;
    }
    
    .detector-description {
        font-size: 1rem;
    }
    
    .detect-button {
        padding: 16px 24px;
        font-size: 16px;
    }
    
    .analysis-textarea,
    .context-textarea,
    .styled-select {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .action-btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }
    
    .probability-number {
        font-size: 2rem;
    }
    
    .form-group {
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* Animation for smooth transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: fadeInUp 0.6s ease-out;
}

.error-section {
    animation: fadeInUp 0.4s ease-out;
}

.sentence-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Enhanced Dark Theme - Modern Look */
.ai-detector-pro * {
    box-sizing: border-box;
}

/* Better scrollbar styling */
.ai-detector-pro ::-webkit-scrollbar {
    width: 8px;
}

.ai-detector-pro ::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.ai-detector-pro ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-radius: 4px;
}

.ai-detector-pro ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed, #0891b2);
}

/* Focus states for better accessibility */
.ai-detector-pro button:focus,
.ai-detector-pro select:focus,
.ai-detector-pro textarea:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Selection styling */
.ai-detector-pro ::selection {
    background: rgba(139, 92, 246, 0.3);
    color: #f1f5f9;
}

/* Print styles */
@media print {
    .ai-detector-pro {
        background: white;
        color: black;
        box-shadow: none;
    }
    
    .results-actions,
    .loading-section,
    .sample-texts,
    .detect-button {
        display: none !important;
    }
    
    .detector-form-section,
    .results-section {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    .detector-header {
        background: #f5f5f5;
        color: black;
    }
}

/* Model Information Styling */
.metric-value.model-premium {
    color: #8b5cf6;
    font-weight: 700;
}

.metric-value.model-free {
    color: #10b981;
    font-weight: 700;
}

.metric-value.model-unknown {
    color: #94a3b8;
    font-weight: 600;
}