/* POC Personality Cards - Enhanced Cosmic Styling */

.personalities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
    padding: 20px 0;
}

.personality-card {
    position: relative;
    padding: 25px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid transparent;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Animated neon border for personality cards */
.personality-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(45deg, #ff60f6, #a86bff, #66e6ff, #ff60f6);
    background-size: 400% 400%;
    animation: cosmicBorder 8s ease-in-out infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0.7;
}

@keyframes cosmicBorder {
    0%, 100% { 
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    25% { 
        background-position: 100% 50%;
        filter: hue-rotate(90deg);
    }
    50% { 
        background-position: 100% 100%;
        filter: hue-rotate(180deg);
    }
    75% { 
        background-position: 0% 100%;
        filter: hue-rotate(270deg);
    }
}

/* Hover effects */
.personality-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(255, 96, 246, 0.3),
        0 0 60px rgba(168, 107, 255, 0.2);
}

.personality-card:hover::before {
    animation-duration: 3s;
    opacity: 1;
    filter: brightness(1.3) saturate(1.2);
}

/* Personality image styling */
.personality-image {
    margin-bottom: 20px;
    position: relative;
}

.personality-image img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    filter: brightness(1.1) contrast(1.1);
}

.personality-card:hover .personality-image img {
    border-color: var(--neon-purple);
    box-shadow: 0 0 25px rgba(168, 107, 255, 0.6);
    transform: scale(1.05);
}

/* Personality info styling */
.personality-info h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.personality-details {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* Enhanced accuracy display with color coding */
.accuracy-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.accuracy-display::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accuracy-color, #666);
    opacity: 0.8;
}

.accuracy-number {
    font-size: 28px;
    font-weight: 800;
    text-shadow: 0 0 15px currentColor;
    transition: all 0.3s ease;
}

.accuracy-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    opacity: 0.8;
}

/* Color-coded accuracy levels */
.accuracy-green {
    --accuracy-color: #10b981;
}

.accuracy-green .accuracy-number {
    color: #10b981;
}

.accuracy-green .accuracy-display::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.accuracy-yellow {
    --accuracy-color: #f59e0b;
}

.accuracy-yellow .accuracy-number {
    color: #f59e0b;
}

.accuracy-yellow .accuracy-display::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.accuracy-red {
    --accuracy-color: #ef4444;
}

.accuracy-red .accuracy-number {
    color: #ef4444;
}

.accuracy-red .accuracy-display::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Hover glow effects for accuracy */
.personality-card:hover .accuracy-display {
    box-shadow: 0 0 20px rgba(var(--accuracy-color), 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.personality-card:hover .accuracy-number {
    transform: scale(1.05);
    text-shadow: 0 0 20px currentColor;
}

/* Modal enhancements */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(15px);
    }
}

.personality-modal-content {
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(10, 12, 42, 0.95);
    border: 2px solid rgba(168, 107, 255, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(168, 107, 255, 0.2);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 96, 246, 0.2);
    color: var(--neon-pink);
    transform: rotate(90deg);
}

/* Personality overview in modal */
.personality-overview {
    display: flex;
    gap: 25px;
    padding: 25px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.personality-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--neon-purple);
    box-shadow: 0 0 30px rgba(168, 107, 255, 0.4);
}

.personality-basic-info h3 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.personality-basic-info p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Enhanced accuracy meter */
.overall-accuracy {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.accuracy-meter {
    width: 120px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.meter-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive design */
@media (max-width: 768px) {
    .personalities-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .personality-card {
        padding: 20px;
        min-height: 260px;
    }
    
    .personality-image img {
        width: 80px;
        height: 80px;
    }
    
    .personality-info h3 {
        font-size: 18px;
    }
    
    .accuracy-number {
        font-size: 24px;
    }
    
    .personality-overview {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .personality-avatar img {
        width: 100px;
        height: 100px;
    }
    
    .personality-modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .personality-card {
        padding: 15px;
        min-height: 240px;
    }
    
    .personality-image img {
        width: 70px;
        height: 70px;
    }
    
    .accuracy-number {
        font-size: 22px;
    }
}

/* Loading animation for personality cards */
.personality-card.loading {
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.6s ease-out forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for grid */
.personality-card:nth-child(1) { animation-delay: 0.1s; }
.personality-card:nth-child(2) { animation-delay: 0.2s; }
.personality-card:nth-child(3) { animation-delay: 0.3s; }
.personality-card:nth-child(4) { animation-delay: 0.4s; }
.personality-card:nth-child(5) { animation-delay: 0.5s; }
.personality-card:nth-child(6) { animation-delay: 0.6s; }


/* Back to Home Button Styles */
.header-section {
    position: relative;
    margin-bottom: 30px;
}

.back-home-btn {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #4a00e0 0%, #8e2de2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(138, 45, 226, 0.4);
    text-decoration: none;
    z-index: 10;
}

.back-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(138, 45, 226, 0.6);
    color: white;
    text-decoration: none;
}

.back-home-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(138, 45, 226, 0.3);
}

.btn-icon {
    font-size: 18px;
}

/* Enhanced Gradient Text - Only for modal sections */
.modal .gradient-text {
    background: linear-gradient(135deg, #4a00e0 0%, #8e2de2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.modal .section-title.gradient-text {
    background: linear-gradient(135deg, #4a00e0 0%, #8e2de2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Keep original theme gradient for main page titles */
.page-poc .gradient-text:not(.modal .gradient-text) {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* Enhanced Color-Coded Accuracy for Parameters */
.parameter-accuracy.accuracy-green {
    color: #10b981 !important;
    font-weight: 700;
}

.parameter-accuracy.accuracy-yellow {
    color: #f59e0b !important;
    font-weight: 700;
}

.parameter-accuracy.accuracy-red {
    color: #ef4444 !important;
    font-weight: 700;
}

/* Enhanced Overall Accuracy Meter Color Coding */
.accuracy-percentage.accuracy-green {
    color: #10b981 !important;
}

.accuracy-percentage.accuracy-yellow {
    color: #f59e0b !important;
}

.accuracy-percentage.accuracy-red {
    color: #ef4444 !important;
}

/* Meter Fill Color Coding */
.meter-fill.accuracy-green {
    background: linear-gradient(90deg, #10b981, #34d399) !important;
}

.meter-fill.accuracy-yellow {
    background: linear-gradient(90deg, #f59e0b, #fbbf24) !important;
}

.meter-fill.accuracy-red {
    background: linear-gradient(90deg, #ef4444, #f87171) !important;
}

/* Responsive adjustments for Back to Home button */
@media (max-width: 768px) {
    .back-home-btn {
        position: static;
        margin-bottom: 20px;
        align-self: flex-start;
    }
    
    .header-section {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Center align POC page title */
.page-poc .section h1.gradient-text {
    text-align: center;
    margin-bottom: 20px;
}

.page-poc .text-center {
    text-align: center;
    margin-bottom: 30px;
}
