/* Results Section - Optimized Single Container */

/* Main results section - combines background and container */
.results-section {
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2), transparent 50%),
        linear-gradient(135deg, #0a0e27 0%, #151b3d 25%, #1a2352 50%, #151b3d 75%, #0a0e27 100%);
    background-attachment: fixed;
    background-size: 400% 400%;
    animation: gradientAnimation 20s ease infinite;
    min-height: 100vh;
    padding: 40px 20px;
    display: block;
    overflow-x: hidden;
    position: relative;
}

/* Add animated particles background */
.results-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent);
    background-size: 50% 50%;
    background-repeat: repeat;
    opacity: 0.02;
    animation: particleMove 120s linear infinite;
    pointer-events: none;
}

@keyframes particleMove {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(-100%, -100%);
    }
}

/* Desktop centering */
@media (min-width: 769px) {
    .results-section {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 40px;
        padding-bottom: 40px;
    }
    
    /* Ensure proper spacing between cards on desktop */
    .results-header,
    .probability-card,
    .evaluation-summary,
    .evaluation-tabs,
    .tab-content,
    .verdict-card {
        margin-bottom: 25px;
    }
    
    /* Larger padding for desktop */
    .results-content-wrapper {
        padding: 0 30px;
    }
    
    /* Desktop tab layout improvements */
    .result-card {
        min-height: 80px;
    }
    
    .card-header {
        padding: 25px;
    }
    
    /* Better alignment for desktop */
    .evaluation-tabs {
        margin: 30px 0;
    }
}

/* Content wrapper with glass effect */
.results-content-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* Glass effect container for all content */
.results-header,
.probability-card,
.evaluation-summary,
.evaluation-tabs,
.tab-content,
.verdict-card {
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%),
        radial-gradient(circle at top right, rgba(120, 119, 198, 0.1), transparent 50%);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

/* Add holographic effect */
.results-header::before,
.probability-card::before,
.evaluation-summary::before,
.evaluation-tabs::before,
.tab-content::before,
.verdict-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0080, #00ff88, #00d4ff, #ff0080);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(5px);
}

.results-header:hover::before,
.probability-card:hover::before,
.evaluation-summary:hover::before,
.evaluation-tabs:hover::before,
.tab-content:hover::before,
.verdict-card:hover::before {
    opacity: 0.3;
}

/* Header Section */
.results-header {
    text-align: center;
    position: relative;
}

/* AI Badge */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.ai-badge i {
    font-size: 18px;
    animation: rotate 4s linear infinite;
}

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

.results-header h1 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: 'Raleway', 'Nunito', sans-serif;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
    letter-spacing: -0.5px;
    letter-spacing: -0.02em;
}

.results-header p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

/* Clean Probability Display */
.probability-card {
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

/* AI Scanning Animation */
@keyframes aiScan {
    0% {
        transform: translateY(0) scaleX(1);
        opacity: 0;
    }
    50% {
        transform: translateY(50%) scaleX(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(100%) scaleX(1);
        opacity: 0;
    }
}

.probability-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(transparent, #00d4ff, transparent);
    transform: translateX(-50%);
    animation: aiScan 3s ease-in-out infinite;
}

.probability-circle {
    position: relative;
    display: inline-block;
    margin: 20px 0 30px;
    width: 180px;
    height: 180px;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
}

.probability-circle svg {
    width: 100%;
    height: 100%;
}

/* Add pulsing glow */
.probability-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.8;
    }
}

#progress-ring-circle {
    transition: stroke-dashoffset 2s cubic-bezier(0.65, 0, 0.35, 1);
}

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

.probability-value {
    font-size: 56px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    font-family: 'Raleway', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.probability-symbol {
    font-size: 28px;
    font-weight: 700;
    color: #ffd700;
}

.probability-label {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.probability-message {
    margin: 20px 0;
}

.probability-message p {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.probability-message strong {
    color: #ffd700;
    font-weight: 700;
}

.probability-details {
    margin-top: 25px;
    height: 30px;
    overflow: hidden;
}

.detail-carousel {
    position: relative;
    height: 100%;
}

.detail-item {
    position: absolute;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.detail-item.active {
    opacity: 1;
    transform: translateY(0);
}

.detail-item i {
    font-size: 18px;
    color: #8fb5e0;
}

/* Button Styling */
.probability-message .btn-primary {
    background: #1c164a;
    border: none;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s ease;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.probability-message .btn-primary:hover {
    background: #252073;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Results Cards Design */
.results-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%),
        radial-gradient(circle at top left, rgba(0, 212, 255, 0.05), transparent 50%);
    backdrop-filter: blur(15px) saturate(120%);
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* AI Data Stream Effect */
.result-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.result-card:hover::after {
    left: 100%;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(143, 181, 224, 0.3);
}

.result-card.active {
    border-color: #8fb5e0;
    box-shadow: 0 10px 30px rgba(143, 181, 224, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

/* Icon colors */
.result-card[data-type="positive"] .card-icon {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.result-card[data-type="positive"].active .card-icon {
    background: #28a745;
    color: white;
    transform: rotate(360deg);
}

.result-card[data-type="risks"] .card-icon {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.result-card[data-type="risks"].active .card-icon {
    background: #ffc107;
    color: white;
    transform: rotate(360deg);
}

.result-card[data-type="recommendations"] .card-icon {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

.result-card[data-type="recommendations"].active .card-icon {
    background: #17a2b8;
    color: white;
    transform: rotate(360deg);
}

.card-title {
    flex: 1;
}

.card-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 5px 0;
    font-family: 'Raleway', sans-serif;
}

.card-title p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-family: 'Nunito', sans-serif;
}

/* Contador de cards premium */
.card-count {
    position: relative;
    min-width: 45px;
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Efecto de brillo animado */
.card-count::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

/* Gradientes base para cada tipo de card con mejor contraste */
.result-card[data-type="positive"] .card-count {
    background: linear-gradient(135deg, #00c896, #00a77a);
    box-shadow: 0 2px 8px rgba(0, 200, 150, 0.3);
    border-color: rgba(0, 255, 200, 0.3);
}

.result-card[data-type="risks"] .card-count {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
    border-color: rgba(255, 180, 0, 0.3);
}

.result-card[data-type="recommendations"] .card-count {
    background: linear-gradient(135deg, #5cb3cc, #3a8fb0);
    box-shadow: 0 2px 8px rgba(92, 179, 204, 0.3);
    border-color: rgba(92, 179, 204, 0.3);
}

/* Efectos hover con micro-interacciones */
.card-count:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-count:hover::before {
    opacity: 1;
}

/* Estado activo con pulso */
.result-card.active .card-count {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Animación de entrada suave */
@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.card-count {
    animation: countUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Números grandes con mejor legibilidad */
.card-count[data-count="0"] {
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Efecto de transición al cambiar números */
.card-count.updating {
    transform: scale(1.1);
}

.card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    padding: 0 20px;
}

.result-card.active .card-content {
    max-height: 500px;
    padding: 20px;
    overflow-y: auto;
}

/* Smooth scroll for content */
.card-content::-webkit-scrollbar {
    width: 6px;
}

.card-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.card-content::-webkit-scrollbar-thumb {
    background: rgba(143, 181, 224, 0.5);
    border-radius: 3px;
}

/* Card expand indicator on bottom of header */
.card-header::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card.active .card-header::after {
    background: #8fb5e0;
    width: 60px;
    box-shadow: 0 0 10px rgba(143, 181, 224, 0.5);
}

/* Alternative: Corner indicator */
.result-card::before {
    content: '';
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0.7;
}

.result-card.active::before {
    transform: rotate(-135deg);
    border-color: #8fb5e0;
    opacity: 1;
}

/* Hover effect para indicar clickeable */
.card-header:hover::after {
    background: rgba(143, 181, 224, 0.5);
}

/* Tab Content */
.tab-content {
    margin-top: 15px;
}

/* Result Lists */
.result-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-list li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    color: #ffffff;
}

.result-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(143, 181, 224, 0.3);
}

.positive-list li::before {
    content: "✓";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.5);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.risk-list li::before {
    content: "!";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.recommendation-list li::before {
    content: "→";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.5);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Buttons */
.btn-primary {
    background: #1c164a;
    border: none;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s ease;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #252073;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #8fb5e0;
    color: #ffffff;
}

#restart-btn {
    background: transparent;
    border: 2px solid #8fb5e0;
    color: #8fb5e0;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 5px;
    transition: all 0.3s ease;
}

#restart-btn:hover {
    background: rgba(143, 181, 224, 0.1);
    border-color: #a5c4e9;
    transform: translateY(-2px);
}

/* Verdict Card */
.verdict-icon {
    font-size: 48px;
    color: #ffd700;
    margin-bottom: 20px;
}

.verdict-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    font-family: 'Raleway', sans-serif;
}

.verdict-text {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Critical Alerts */
.critical-alerts .alert {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    color: #ffffff;
    padding: 20px;
}

.critical-alerts h5 {
    font-weight: 600;
    margin-bottom: 15px;
    color: #ff6b6b;
}

.critical-list {
    list-style: none;
    padding: 0;
}

.critical-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.critical-list li:last-child {
    border-bottom: none;
}

/* Animations */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* AI Processing Animation */
@keyframes aiProcessing {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.results-content-wrapper > * {
    animation: aiProcessing 0.8s ease-out forwards;
}

.results-content-wrapper > *:nth-child(1) { animation-delay: 0.1s; }
.results-content-wrapper > *:nth-child(2) { animation-delay: 0.2s; }
.results-content-wrapper > *:nth-child(3) { animation-delay: 0.3s; }
.results-content-wrapper > *:nth-child(4) { animation-delay: 0.4s; }
.results-content-wrapper > *:nth-child(5) { animation-delay: 0.5s; }

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

.results-section.show {
    animation: fadeIn 0.5s ease-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-section {
        padding: 15px;
        min-height: 100vh;
        display: block;
    }
    
    .results-header,
    .probability-card,
    .evaluation-summary,
    .tab-content,
    .verdict-card {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .results-header h1 {
        font-size: 24px;
    }
    
    .probability-value {
        font-size: 48px;
    }
    
    .probability-symbol {
        font-size: 24px;
    }
    
    .probability-label {
        font-size: 16px;
    }
    
    .probability-details {
        gap: 15px;
    }
    
    .detail-item {
        font-size: 12px;
    }
    
    .results-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-card {
        margin-bottom: 0;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .card-title h3 {
        font-size: 16px;
    }
    
    .card-title p {
        font-size: 13px;
    }
    
    .card-count {
        min-width: 40px;
        height: 28px;
        padding: 0 10px;
        font-size: 14px;
    }
    
    .result-list li {
        padding: 10px 12px;
    }
}

/* Ensure all text is visible */
.results-section * {
    color: #ffffff;
}

.results-section h1,
.results-section h2,
.results-section h3,
.results-section h4,
.results-section h5,
.results-section h6 {
    color: #ffffff;
}

.results-section p {
    color: rgba(255, 255, 255, 0.9);
}