/**
 * Birth Numerology Game - Frontend Styles
 */

.bng-widget-container {
    max-width: 740px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bng-widget-title {
    text-align: center;
    color: #333;
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 600;
}

.bng-form {
    width: 100%;
}

.bng-form-group {
    margin-bottom: 20px;
}

.bng-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.bng-form-group .required {
    color: #e74c3c;
    margin-left: 3px;
}

.bng-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.bng-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.bng-submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bng-submit-btn:hover {
    background-color: #005a87;
}

.bng-submit-btn:active {
    transform: translateY(1px);
}

.bng-result {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: #ffffff;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bng-result-heading {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 500;
    opacity: 0.9;
}

.bng-result-number {
    font-size: 72px;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.bng-result-title {
    font-size: 28px;
    margin: 20px 0;
    font-weight: 600;
}

.bng-result-message {
    font-size: 16px;
    line-height: 1.6;
    margin: 20px 0 0 0;
    opacity: 0.95;
}

.bng-loading {
    text-align: center;
    padding: 40px;
}

.bng-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lottie Animation Container */
.bng-lottie-container {
    text-align: center;
    padding: 40px 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 8px;
    margin: 20px 0;
}

.bng-lottie-animation {
    max-width: 100%;
    margin: 0 auto;
}

.bng-lottie-animation.calculation-mode {
    height: auto;
    min-height: 300px;
}

/* Calculation Animation */
.bng-calculation-animation {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #333;
}

.calc-step {
    color: WHITE;
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
    animation: fadeInStep 0.5s ease;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calc-final {
    font-size: 24px;
    font-weight: bold;
    color: #c9a87a;
    margin: 20px 0;
    text-align: center;
}

.calc-number {
    font-size: 48px;
    color: #c9a87a;
    display: block;
    margin: 10px 0;
}

.calc-meaning {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #c9a87a;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

/* Fallback animation (if Lottie fails to load) */
.bng-fallback-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 48px;
}

.bng-sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
    display: inline-block;
}

.bng-sparkle:nth-child(1) {
    animation-delay: 0s;
}

.bng-sparkle:nth-child(2) {
    animation-delay: 0.3s;
    font-size: 64px;
}

.bng-sparkle:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        opacity: 1;
    }
}

@media (max-width: 768px) {

    
    .bng-lottie-container {
        min-height: 250px;
        padding: 30px 15px;
    }
    
    .bng-fallback-animation {
        font-size: 36px;
        gap: 15px;
    }
    
    .bng-sparkle:nth-child(2) {
        font-size: 48px;
    }
}

.bng-disclaimer {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #ffc107;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bng-widget-container {
        padding: 20px;
    }
    
    .bng-widget-title {
        font-size: 24px;
    }
    
    .bng-result-number {
        font-size: 56px;
    }
    
    .bng-result-title {
        font-size: 22px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bng-widget-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .bng-widget-title {
        color: #c9a87a;
    }
    
    .bng-form-group label {
        color: #bdc3c7;
    }
    
    .bng-input {
        background: #34495e;
        border-color: #4a5f7f;
        color: #ecf0f1;
    }
    
    .bng-input:focus {
        border-color: #3498db;
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    }
}

/* Accessibility */
.bng-input:invalid {
    border-color: #e74c3c;
}

.bng-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation for error messages */
.bng-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Three-section result layout */
.bng-result-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 25px 0;
}

.bng-section {
    background: rgba(255, 255, 255, 0.15);
    padding: 25px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.bng-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

.bng-section:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.bng-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    border-bottom: 3px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bng-section.financial {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-top-color: #f1c40f;
}

.bng-section.financial::before {
    background: linear-gradient(90deg, #f1c40f, #f39c12, #f1c40f);
}

.bng-section.relational {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-top-color: #e74c3c;
}

.bng-section.relational::before {
    background: linear-gradient(90deg, #e74c3c, #c0392b, #e74c3c);
}

.bng-section.spiritual {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-top-color: #9b59b6;
}

.bng-section.spiritual::before {
    background: linear-gradient(90deg, #9b59b6, #8e44ad, #9b59b6);
}

.bng-section p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #f8f9fa;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Section icons */
.bng-section h4::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.bng-section.financial h4::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f1c40f"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"/></svg>');
}

.bng-section.relational h4::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M16 4c0-1.11.89-2 2-2s2 .89 2 2-.89 2-2 2-2-.89-2-2zm4 18v-6h2.5l-2.54-7.63A1.5 1.5 0 0 0 18.54 8H16c-.8 0-1.54.37-2.01 1.01L12 13l-1.99-3.99C9.54 9.37 8.8 9 8 9H5.46c-.8 0-1.51.57-1.54 1.37L1.5 16H4v6h16z"/></svg>');
}

.bng-section.spiritual h4::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239b59b6"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
}

/* Responsive design for sections */
@media (max-width: 768px) {
    .bng-result-sections {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bng-section {
        padding: 15px;
    }
    
    .bng-section h4 {
        font-size: 16px;
    }
}

/* Animation for sections */
@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bng-section {
    animation: fadeInSection 0.6s ease forwards;
    opacity: 0;
}

.bng-section:nth-child(1) {
    animation-delay: 0.1s;
}

.bng-section:nth-child(2) {
    animation-delay: 0.2s;
}

.bng-section:nth-child(3) {
    animation-delay: 0.3s;
}

/* Update result message container to handle HTML content */
.bng-result-message {
    text-align: left;
}
