/* WordPress-scoped CSS for Prediction Tool */
/* All styles wrapped with .prediction-tool-wrapper to avoid conflicts */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;500;600;700&display=swap');

/* Scoped Reset */
.prediction-tool-wrapper * {
    box-sizing: border-box;
}

.prediction-tool-wrapper {
    font-family: 'Arial Black', Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
}

/* Break out of theme container constraints - only when visible */
.prediction-tool-wrapper .canvas-section[style*="display: block"],
.prediction-tool-wrapper .canvas-section:not([style*="display: none"]) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #f5f5f5 !important;
    overflow: auto !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Reset canvas section when hidden */
.prediction-tool-wrapper .canvas-section[style*="display: none"] {
    position: static !important;
    width: auto !important;
    height: auto !important;
    z-index: 1 !important;
}

.prediction-tool-wrapper .canvas-container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.prediction-tool-wrapper .stage {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.prediction-tool-wrapper #squareChart {
    max-width: 100%;
    height: auto !important;
    width: auto !important;
    display: block;
    margin: 0 auto;
}

/* Override any theme container constraints */
.prediction-tool-wrapper .canvas-section * {
    max-width: none !important;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .prediction-tool-wrapper * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.prediction-tool-wrapper button:focus,
.prediction-tool-wrapper input:focus,
.prediction-tool-wrapper select:focus,
.prediction-tool-wrapper a:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

.prediction-tool-wrapper .center-title {
    text-align: center;
    color: white;
    display: none;
}

.prediction-tool-wrapper .input-table {
    margin: 20px auto;
    border: 1px solid #aaa;
    padding: 20px;
    border-radius: 12px;
    width: min(95vw, 450px);
    background: rgba(248, 248, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    text-align: left;
    color: #0b2530;
}

.prediction-tool-wrapper .input-table label {
    display: inline-block;
    width: 100%;
    margin-bottom: 8px;
    font-family: 'Arial Black', Arial, sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.prediction-tool-wrapper .input-table input[type="text"],
.prediction-tool-wrapper .input-table input[type="number"],
.prediction-tool-wrapper .input-table input[type="time"],
.prediction-tool-wrapper .input-table select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #0b2530;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.prediction-tool-wrapper .input-table input[type="text"]:focus,
.prediction-tool-wrapper .input-table input[type="number"]:focus,
.prediction-tool-wrapper .input-table input[type="time"]:focus,
.prediction-tool-wrapper .input-table select:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.prediction-tool-wrapper .input-table input[type="text"]:invalid,
.prediction-tool-wrapper .input-table input[type="number"]:invalid {
    border-color: #e74c3c;
}

.prediction-tool-wrapper .input-table .gender-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.prediction-tool-wrapper .input-table .gender-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    cursor: pointer;
}

.prediction-tool-wrapper .input-table input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.prediction-tool-wrapper .input-table fieldset {
    border: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.prediction-tool-wrapper .input-table legend {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.prediction-tool-wrapper .center-btn {
    text-align: center;
    margin-top: 24px;
}

.prediction-tool-wrapper .input-table button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
}

.prediction-tool-wrapper .input-table button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.prediction-tool-wrapper .input-table button:active:not(:disabled) {
    transform: translateY(0);
}

.prediction-tool-wrapper .input-table button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.prediction-tool-wrapper .input-table button span {
    font-size: 20px;
}

/* Hero */
.prediction-tool-wrapper .hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url('../images/background1.jpg') center/cover no-repeat;
    text-align: center;
    color: #fff;
    padding: 60px 16px;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure hero is properly displayed when shown */
.prediction-tool-wrapper .hero[style*="display: block"] {
    display: flex !important;
}

/* Remove hero background after first submission to avoid duplicate */
.prediction-tool-wrapper .hero.submitted {
    background: none;
}

.prediction-tool-wrapper .hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.6) 0%,      /* Dark at top for text readability */
        rgba(0,0,0,0.4) 40%,     /* Gradual transition */
        rgba(0,0,0,0.1) 70%,     /* Getting lighter */
        rgba(0,0,0,0) 100%       /* Fully transparent at bottom - image shows clearly */
    );
    z-index: 1;
}

.prediction-tool-wrapper .hero-inner {
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.prediction-tool-wrapper .hero h1 {
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 56px;
    letter-spacing: 2px;
    margin: 0 0 16px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 
        3px 3px 8px rgba(0,0,0,1), 
        0 0 20px rgba(0,0,0,0.9),
        -1px -1px 0 rgba(0,0,0,0.5),
        1px -1px 0 rgba(0,0,0,0.5),
        -1px 1px 0 rgba(0,0,0,0.5),
        1px 1px 0 rgba(0,0,0,0.5);
}

.prediction-tool-wrapper .hero p {
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 20px;
    opacity: 1;
    margin: 0 0 24px;
    line-height: 1.6;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 
        2px 2px 6px rgba(0,0,0,1), 
        0 0 15px rgba(0,0,0,0.9),
        -1px -1px 0 rgba(0,0,0,0.5),
        1px -1px 0 rgba(0,0,0,0.5),
        -1px 1px 0 rgba(0,0,0,0.5),
        1px 1px 0 rgba(0,0,0,0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .prediction-tool-wrapper .hero h1 {
        font-size: 42px;
        letter-spacing: 2px;
    }
    
    .prediction-tool-wrapper .hero p {
        font-size: 18px;
    }
    
    .prediction-tool-wrapper .input-table {
        padding: 16px;
    }
    
    .prediction-tool-wrapper .input-table button {
        width: 100%;
    }
}

/* Canvas Links Section */
.prediction-tool-wrapper .canvas-links-section a {
    transition: all 0.3s ease !important;
}

@media (max-width: 768px) {
    .prediction-tool-wrapper .canvas-links-section {
        padding: 20px 15px !important;
        margin-top: 15px !important;
    }
    
    .prediction-tool-wrapper .canvas-links-section h3 {
        font-size: 20px !important;
    }
    
    .prediction-tool-wrapper .canvas-links-section a {
        font-size: 16px !important;
        padding: 12px 20px !important;
    }
    
    .prediction-tool-wrapper .canvas-links-section a span:first-child {
        font-size: 20px !important;
    }
}

@media (max-width: 480px) {
    .prediction-tool-wrapper .canvas-links-section {
        padding: 15px 10px !important;
    }
    
    .prediction-tool-wrapper .canvas-links-section h3 {
        font-size: 18px !important;
    }
    
    .prediction-tool-wrapper .canvas-links-section a {
        font-size: 14px !important;
        padding: 10px 15px !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .prediction-tool-wrapper .hero h1 {
        font-size: 32px;
        letter-spacing: 1.5px;
    }
    
    .prediction-tool-wrapper .input-table .gender-group {
        flex-direction: column;
        gap: 12px;
    }
}


