/* =========================================================
   ZNILATHOSS SPORTS
   PREDICTIONS.CSS
   ---------------------------------------------------------
   قسم التوقعات والتحليل
   متوافق مع:
   - prediction.js
   - app.js
   - api.js
   - RTL
   - Desktop
   - Tablet
   - Mobile
   ========================================================= */


/* =========================================================
   ROOT SECTION
   ========================================================= */

#predictions-section {

    width: 100%;
    max-width: 1400px;

    margin: 0 auto;

    padding: 20px;

    box-sizing: border-box;

    direction: rtl;

    text-align: right;

}


/* =========================================================
   BOX SIZING
   ========================================================= */

#predictions-section *,
#predictions-section *::before,
#predictions-section *::after {

    box-sizing: border-box;

}


/* =========================================================
   FORM ELEMENTS
   ========================================================= */

#predictions-section select,
#predictions-section textarea,
#predictions-section button {

    font-family: inherit;

}


/* =========================================================
   SELECT
   ========================================================= */

#predictionFixture,
#predictionType {

    display: block;

    width: 100%;

    min-height: 48px;

    margin: 0 0 12px;

    padding: 10px 14px;

    border: 1px solid #d8e0ea;

    border-radius: 10px;

    outline: none;

    background: #ffffff;

    color: #071b3a;

    font-size: 15px;

    font-weight: 600;

    line-height: 1.5;

    text-align: right;

    direction: rtl;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;

}


/* =========================================================
   SELECT HOVER
   ========================================================= */

#predictionFixture:hover,
#predictionType:hover {

    border-color: #b8c6d8;

}


/* =========================================================
   SELECT FOCUS
   ========================================================= */

#predictionFixture:focus,
#predictionType:focus {

    border-color: #071b3a;

    box-shadow:
        0 0 0 3px rgba(7, 27, 58, 0.10);

}


/* =========================================================
   TEXTAREA
   ========================================================= */

#predictionPrompt {

    display: block;

    width: 100%;

    min-height: 110px;

    margin: 0 0 14px;

    padding: 14px;

    border: 1px solid #d8e0ea;

    border-radius: 12px;

    outline: none;

    background: #ffffff;

    color: #172033;

    font-family: inherit;

    font-size: 15px;

    line-height: 1.8;

    text-align: right;

    direction: rtl;

    resize: vertical;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;

}


/* =========================================================
   TEXTAREA PLACEHOLDER
   ========================================================= */

#predictionPrompt::placeholder {

    color: #8a94a6;

}


/* =========================================================
   TEXTAREA FOCUS
   ========================================================= */

#predictionPrompt:focus {

    border-color: #071b3a;

    box-shadow:
        0 0 0 3px rgba(7, 27, 58, 0.10);

}


/* =========================================================
   ANALYZE BUTTON
   ========================================================= */

#predictionAnalyzeButton {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    min-height: 52px;

    margin: 0;

    padding: 12px 20px;

    border: 0;

    border-radius: 12px;

    outline: none;

    background: #071b3a;

    color: #ffffff;

    font-family: inherit;

    font-size: 16px;

    font-weight: 700;

    line-height: 1.4;

    text-align: center;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;

}


/* =========================================================
   BUTTON HOVER
   ========================================================= */

#predictionAnalyzeButton:hover {

    background: #0d2d5c;

    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(7, 27, 58, 0.18);

}


/* =========================================================
   BUTTON ACTIVE
   ========================================================= */

#predictionAnalyzeButton:active {

    transform: translateY(0);

    box-shadow: none;

}


/* =========================================================
   BUTTON DISABLED
   ========================================================= */

#predictionAnalyzeButton:disabled {

    opacity: 0.60;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;

}


/* =========================================================
   STATUS
   ========================================================= */

.prediction-status {

    width: 100%;

    margin: 14px 0;

    padding: 10px 14px;

    border-radius: 10px;

    font-size: 14px;

    font-weight: 600;

    line-height: 1.7;

    text-align: center;

}


/* =========================================================
   STATUS LOADING
   ========================================================= */

.prediction-status.is-loading {

    background: #eef4ff;

    color: #164a91;

}


/* =========================================================
   STATUS SUCCESS
   ========================================================= */

.prediction-status.is-success {

    background: #eaf8ef;

    color: #16733b;

}


/* =========================================================
   STATUS ERROR
   ========================================================= */

.prediction-status.is-error {

    background: #fff0f0;

    color: #b42318;

}


/* =========================================================
   STATUS EMPTY
   ========================================================= */

.prediction-status.is-empty {

    background: #f5f6f8;

    color: #596273;

}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

#predictions-container {

    width: 100%;

    margin-top: 20px;

    box-sizing: border-box;

}


/* =========================================================
   RESULT
   ========================================================= */

#predictionResult {

    width: 100%;

    min-width: 0;

    box-sizing: border-box;

}


/* =========================================================
   SELECTED MATCH
   ========================================================= */

.prediction-selected {

    width: 100%;

    margin: 0 0 20px;

    padding: 20px;

    border: 1px solid #dce3ec;

    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        0 5px 20px rgba(7, 27, 58, 0.07);

    text-align: center;

}


/* =========================================================
   LEAGUE
   ========================================================= */

.prediction-selected-league {

    margin: 0 0 18px;

    color: #687386;

    font-size: 14px;

    font-weight: 700;

    line-height: 1.6;

}


/* =========================================================
   TEAMS
   ========================================================= */

.prediction-selected-teams {

    display: flex !important;

    flex-direction: row !important;

    align-items: center;

    justify-content: center;

    width: 100%;

    gap: 35px;

}


/* =========================================================
   TEAM
   ========================================================= */

.prediction-selected-team {

    flex: 1 1 0;

    min-width: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 8px;

    text-align: center;

}


/* =========================================================
   TEAM LOGO
   ========================================================= */

.prediction-selected-team img,
.prediction-selected-team > img {

    display: block;

    width: 65px;

    height: 65px;

    max-width: 65px;

    object-fit: contain;

}


/* =========================================================
   TEAM NAME
   ========================================================= */

.prediction-selected-team strong {

    display: block;

    max-width: 100%;

    color: #071b3a;

    font-size: 16px;

    font-weight: 800;

    line-height: 1.5;

    overflow-wrap: anywhere;

}


/* =========================================================
   TEAM PLACEHOLDER
   ========================================================= */

.prediction-team-placeholder {

    width: 65px;

    height: 65px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex: 0 0 65px;

    border-radius: 50%;

    background: #eef2f7;

    color: #64748b;

    font-size: 28px;

}


/* =========================================================
   VS
   ========================================================= */

.prediction-selected-vs {

    flex: 0 0 46px;

    width: 46px;

    height: 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: #071b3a;

    color: #ffffff;

    font-size: 13px;

    font-weight: 800;

}


/* =========================================================
   MATCH INFO
   ========================================================= */

.prediction-selected-info {

    display: flex;

    flex-direction: row;

    flex-wrap: wrap;

    align-items: center;

    justify-content: center;

    gap: 15px;

    margin-top: 18px;

    color: #596273;

    font-size: 14px;

    line-height: 1.6;

}


/* =========================================================
   SELECTED DESCRIPTION
   ========================================================= */

.prediction-selected p {

    margin: 15px 0 0;

    color: #687386;

    font-size: 14px;

    line-height: 1.9;

}


/* =========================================================
   AI RESULT
   ========================================================= */

.prediction-ai-result {

    display: block !important;

    width: 100%;

    min-width: 0;

    overflow: hidden;

    border: 1px solid #dce3ec;

    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 8px 28px rgba(7, 27, 58, 0.09);

}


/* =========================================================
   AI HEADER
   ========================================================= */

.prediction-ai-header {

    width: 100%;

    padding: 18px 22px;

    box-sizing: border-box;

    background: #071b3a;

    color: #ffffff;

    text-align: right;

}


/* =========================================================
   AI HEADER INNER
   ========================================================= */

.prediction-ai-header > div {

    width: 100%;

}


/* =========================================================
   AI LABEL
   ========================================================= */

.prediction-ai-label {

    display: inline-flex;

    align-items: center;

    gap: 7px;

    margin: 0 0 8px;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

}


/* =========================================================
   AI TITLE
   ========================================================= */

.prediction-ai-header h2 {

    margin: 0;

    color: #ffffff;

    font-size: 21px;

    font-weight: 800;

    line-height: 1.5;

    text-align: right;

}


/* =========================================================
   AI META
   ========================================================= */

.prediction-ai-meta {

    width: 100%;

    display: flex !important;

    flex-direction: row !important;

    flex-wrap: nowrap;

    align-items: stretch;

    justify-content: center;

    gap: 10px;

    padding: 14px;

    background: #f4f7fb;

    border-bottom: 1px solid #e1e7ef;

    overflow-x: auto;

    scrollbar-width: thin;

}


/* =========================================================
   AI META ITEM
   ========================================================= */

.prediction-ai-meta span {

    flex: 1 1 0;

    min-width: 150px;

    min-height: 42px;

    display: flex !important;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 10px 14px;

    border: 1px solid #dce3ec;

    border-radius: 10px;

    background: #ffffff;

    color: #071b3a;

    font-size: 13px;

    font-weight: 700;

    line-height: 1.5;

    text-align: center;

    white-space: nowrap;

}


/* =========================================================
   AI CONTENT
   ========================================================= */

.prediction-ai-content {

    display: block;

    width: 100%;

    min-width: 0;

    padding: 22px;

    background: #ffffff;

    color: #202938;

    font-size: 15px;

    line-height: 2;

    text-align: right;

    direction: rtl;

    white-space: normal;

    overflow-wrap: anywhere;

    word-break: normal;

}


/* =========================================================
   CONTENT ELEMENTS
   ========================================================= */

.prediction-ai-content p {

    margin: 0 0 14px;

}


.prediction-ai-content p:last-child {

    margin-bottom: 0;

}


.prediction-ai-content strong {

    color: #071b3a;

    font-weight: 800;

}


.prediction-ai-content em {

    color: #334155;

}


/* =========================================================
   LISTS
   ========================================================= */

.prediction-ai-content ul,
.prediction-ai-content ol {

    margin: 12px 0;

    padding-right: 25px;

}


.prediction-ai-content li {

    margin-bottom: 7px;

    line-height: 1.9;

}


/* =========================================================
   TABLES INSIDE AI RESULT
   ========================================================= */

.prediction-ai-content table {

    width: 100%;

    margin: 15px 0;

    border-collapse: collapse;

    border-spacing: 0;

    overflow: hidden;

    border: 1px solid #dce3ec;

    border-radius: 10px;

    font-size: 14px;

}


.prediction-ai-content th,
.prediction-ai-content td {

    padding: 10px;

    border: 1px solid #dce3ec;

    text-align: center;

    vertical-align: middle;

}


.prediction-ai-content th {

    background: #071b3a;

    color: #ffffff;

    font-weight: 800;

}


.prediction-ai-content td {

    background: #ffffff;

    color: #263246;

}


/* =========================================================
   DISCLAIMER
   ========================================================= */

.prediction-ai-disclaimer {

    width: 100%;

    padding: 13px 18px;

    border-top: 1px solid #eadca9;

    background: #fff9df;

    color: #715d00;

    font-size: 13px;

    line-height: 1.8;

    text-align: right;

}


/* =========================================================
   LOADING
   ========================================================= */

.prediction-loading {

    width: 100%;

    padding: 45px 20px;

    border: 1px solid #dce3ec;

    border-radius: 16px;

    background: #ffffff;

    text-align: center;

}


/* =========================================================
   SPINNER
   ========================================================= */

.prediction-spinner {

    width: 42px;

    height: 42px;

    margin: 0 auto 15px;

    border: 4px solid #dce3ec;

    border-top-color: #071b3a;

    border-radius: 50%;

    animation:
        predictionSpin 0.8s linear infinite;

}


@keyframes predictionSpin {

    from {

        transform: rotate(0deg);

    }

    to {

        transform: rotate(360deg);

    }

}


/* =========================================================
   LOADING TEXT
   ========================================================= */

.prediction-loading h3 {

    margin: 0 0 8px;

    color: #071b3a;

    font-size: 18px;

}


.prediction-loading p {

    margin: 0;

    color: #687386;

    font-size: 14px;

    line-height: 1.8;

}


/* =========================================================
   EMPTY
   ========================================================= */

.prediction-empty {

    width: 100%;

    padding: 45px 20px;

    border: 1px solid #dce3ec;

    border-radius: 16px;

    background: #ffffff;

    text-align: center;

}


/* =========================================================
   EMPTY ICON
   ========================================================= */

.prediction-empty-icon {

    margin-bottom: 12px;

    font-size: 42px;

}


/* =========================================================
   EMPTY TITLE
   ========================================================= */

.prediction-empty h3 {

    margin: 0 0 8px;

    color: #071b3a;

    font-size: 19px;

}


/* =========================================================
   EMPTY TEXT
   ========================================================= */

.prediction-empty p {

    max-width: 650px;

    margin: 0 auto;

    color: #687386;

    line-height: 1.9;

}


/* =========================================================
   ERROR
   ========================================================= */

.prediction-error {

    width: 100%;

    padding: 35px 20px;

    border: 1px solid #f1caca;

    border-radius: 16px;

    background: #fff6f6;

    text-align: center;

}


/* =========================================================
   ERROR ICON
   ========================================================= */

.prediction-error-icon {

    margin-bottom: 10px;

    font-size: 40px;

}


/* =========================================================
   ERROR TITLE
   ========================================================= */

.prediction-error h3 {

    margin: 0 0 8px;

    color: #a61b1b;

    font-size: 19px;

}


/* =========================================================
   ERROR TEXT
   ========================================================= */

.prediction-error p {

    margin: 0;

    color: #7a3030;

    line-height: 1.8;

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {

    #predictions-section {

        padding: 15px;

    }


    .prediction-ai-meta {

        flex-wrap: wrap;

    }


    .prediction-ai-meta span {

        min-width: calc(33.333% - 10px);

    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 650px) {

    #predictions-section {

        padding: 10px;

    }


    .prediction-selected {

        padding: 15px;

        border-radius: 14px;

    }


    .prediction-selected-teams {

        gap: 12px;

    }


    .prediction-selected-team img,
    .prediction-selected-team > img,
    .prediction-team-placeholder {

        width: 52px;

        height: 52px;

        max-width: 52px;

    }


    .prediction-team-placeholder {

        flex-basis: 52px;

    }


    .prediction-selected-team strong {

        font-size: 13px;

    }


    .prediction-selected-vs {

        flex-basis: 38px;

        width: 38px;

        height: 38px;

        font-size: 11px;

    }


    .prediction-selected-info {

        gap: 8px;

        font-size: 12px;

    }


    .prediction-ai-header {

        padding: 15px;

    }


    .prediction-ai-header h2 {

        font-size: 17px;

    }


    .prediction-ai-meta {

        gap: 7px;

        padding: 10px;

    }


    .prediction-ai-meta span {

        flex: 1 1 100%;

        min-width: 100%;

    }


    .prediction-ai-content {

        padding: 16px;

        font-size: 14px;

        line-height: 1.9;

    }


    .prediction-ai-content table {

        display: block;

        width: 100%;

        overflow-x: auto;

        white-space: nowrap;

    }


    .prediction-ai-disclaimer {

        padding: 12px 14px;

        font-size: 12px;

    }


    .prediction-loading,
    .prediction-empty {

        padding: 35px 15px;

    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 400px) {

    #predictions-section {

        padding: 8px;

    }


    .prediction-selected-teams {

        gap: 7px;

    }


    .prediction-selected-team img,
    .prediction-selected-team > img,
    .prediction-team-placeholder {

        width: 46px;

        height: 46px;

        max-width: 46px;

    }


    .prediction-team-placeholder {

        flex-basis: 46px;

        font-size: 22px;

    }


    .prediction-selected-vs {

        flex-basis: 34px;

        width: 34px;

        height: 34px;

        font-size: 10px;

    }


    .prediction-selected-team strong {

        font-size: 12px;

    }

}


/* =========================================================
   RTL
   ========================================================= */

[dir="rtl"] #predictions-section {

    direction: rtl;

}


[dir="rtl"] #predictionFixture,
[dir="rtl"] #predictionType,
[dir="rtl"] #predictionPrompt {

    direction: rtl;

    text-align: right;

}


[dir="rtl"] .prediction-ai-content {

    direction: rtl;

    text-align: right;

}


/* =========================================================
   IMPORTANT FIX
   ---------------------------------------------------------
   منع CSS العام من تحويل عناصر Predictions
   إلى layout عمودي غير مرغوب
   ========================================================= */

#predictionResult .prediction-ai-result {

    display: block !important;

    width: 100% !important;

}


#predictionResult .prediction-ai-meta {

    display: flex !important;

    flex-direction: row !important;

    width: 100% !important;

}


#predictionResult .prediction-ai-meta span {

    display: flex !important;

}


#predictionResult .prediction-selected-teams {

    display: flex !important;

    flex-direction: row !important;

}


/* =========================================================
   منع انكماش المحتوى
   ========================================================= */

#predictionResult,
#predictions-container,
.prediction-ai-result,
.prediction-ai-content {

    min-width: 0;

    max-width: 100%;

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

#predictionAnalyzeButton:focus-visible {

    outline: 3px solid rgba(59, 130, 246, 0.35);

    outline-offset: 2px;

}


#predictionFixture:focus-visible,
#predictionType:focus-visible,
#predictionPrompt:focus-visible {

    outline: 3px solid rgba(59, 130, 246, 0.25);

    outline-offset: 1px;

}


/* =========================================================
   END
   ========================================================= */