﻿/* =========================================================
   Class Rules Page
   ========================================================= */

.tc-class-rules-page {
    --cr-primary: #4f46e5;
    --cr-primary-dark: #3730a3;
    --cr-primary-soft: #eef2ff;
    --cr-text: #172033;
    --cr-muted: #687386;
    --cr-border: #e7eaf0;
    --cr-bg: #f6f8fc;
    --cr-card: #ffffff;
    --cr-success: #16a34a;
    --cr-warning: #f59e0b;
    --cr-radius: 22px;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 0%, rgba(79,70,229,.10), transparent 30%), radial-gradient(circle at 90% 10%, rgba(14,165,233,.08), transparent 28%), var(--cr-bg);
}


/* =========================================================
   Header
   ========================================================= */

.tc-class-rules-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
    padding: 38px;
    border: 1px solid var(--cr-border);
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    box-shadow: 0 18px 50px rgba(30, 41, 59, .08);
}

    .tc-class-rules-hero::before {
        content: "";
        position: absolute;
        width: 260px;
        height: 260px;
        border-radius: 50%;
        background: rgba(79, 70, 229, .08);
        top: -130px;
        left: -80px;
    }

.tc-class-rules-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 22px;
}

.tc-class-rules-hero-icon {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: #fff;
    font-size: 34px;
    background: linear-gradient(135deg, var(--cr-primary), #7c3aed);
    box-shadow: 0 14px 30px rgba(79,70,229,.25);
}

.tc-class-rules-hero h2 {
    margin: 0 0 8px;
    color: var(--cr-text);
    font-size: 28px;
    font-weight: 800;
}

.tc-class-rules-hero p {
    margin: 0;
    color: var(--cr-muted);
    line-height: 1.9;
    font-size: 15px;
}


/* =========================================================
   Quick Info
   ========================================================= */

.tc-class-rules-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.tc-class-highlight {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--cr-card);
    border: 1px solid var(--cr-border);
    border-radius: var(--cr-radius);
    box-shadow: 0 10px 30px rgba(30, 41, 59, .05);
    transition: .25s ease;
}

    .tc-class-highlight:hover {
        transform: translateY(-3px);
        box-shadow: 0 16px 35px rgba(30, 41, 59, .09);
    }

.tc-class-highlight-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: var(--cr-primary-soft);
    color: var(--cr-primary);
    font-size: 22px;
}

.tc-class-highlight strong {
    display: block;
    color: var(--cr-text);
    font-size: 15px;
    margin-bottom: 4px;
}

.tc-class-highlight span {
    color: var(--cr-muted);
    font-size: 13px;
}


/* =========================================================
   Rule Cards
   ========================================================= */

.tc-class-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.tc-class-rule-card {
    position: relative;
    padding: 25px;
    background: var(--cr-card);
    border: 1px solid var(--cr-border);
    border-radius: var(--cr-radius);
    box-shadow: 0 10px 28px rgba(30,41,59,.05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

    .tc-class-rule-card:hover {
        transform: translateY(-4px);
        border-color: rgba(79,70,229,.25);
        box-shadow: 0 18px 38px rgba(30,41,59,.10);
    }

.tc-class-rule-card-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
}

.tc-class-rule-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: var(--cr-primary);
    background: var(--cr-primary-soft);
    font-size: 23px;
}

.tc-class-rule-card h3 {
    margin: 0;
    color: var(--cr-text);
    font-size: 17px;
    font-weight: 800;
}

.tc-class-rule-card p {
    margin: 8px 0 0;
    color: var(--cr-muted);
    line-height: 2;
    font-size: 14px;
}

.tc-class-rule-card ul {
    margin: 14px 0 0;
    padding-right: 20px;
    color: var(--cr-muted);
    line-height: 2;
    font-size: 14px;
}

.tc-class-rule-card li {
    margin-bottom: 5px;
}


/* =========================================================
   Payment Card
   ========================================================= */

.tc-class-payment-card {
    margin-top: 20px;
    padding: 28px;
    border-radius: var(--cr-radius);
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 1px solid #dfe3ff;
}

.tc-class-payment-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

    .tc-class-payment-header i {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 15px;
        background: #fff;
        color: var(--cr-primary);
        font-size: 22px;
    }

    .tc-class-payment-header h3 {
        margin: 0;
        color: var(--cr-text);
        font-size: 18px;
    }

.tc-class-payment-card p {
    margin: 0;
    color: #596579;
    line-height: 2;
}


/* =========================================================
   Notice
   ========================================================= */

.tc-class-rules-notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 24px;
    padding: 20px;
    border-radius: 18px;
    background: #fffaf0;
    border: 1px solid #fde7b2;
}

    .tc-class-rules-notice i {
        color: var(--cr-warning);
        font-size: 22px;
        margin-top: 2px;
    }

    .tc-class-rules-notice p {
        margin: 0;
        color: #6b5a2b;
        line-height: 1.9;
        font-size: 14px;
    }


/* =========================================================
   Feedback
   ========================================================= */

.tc-class-feedback {
    margin-top: 35px;
    padding: 30px;
    background: #fff;
    border: 1px solid var(--cr-border);
    border-radius: 26px;
    box-shadow: 0 14px 40px rgba(30,41,59,.07);
}

.tc-class-feedback-header {
    text-align: center;
    margin-bottom: 25px;
}

    .tc-class-feedback-header .icon {
        width: 58px;
        height: 58px;
        margin: 0 auto 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 17px;
        background: var(--cr-primary-soft);
        color: var(--cr-primary);
        font-size: 25px;
    }

    .tc-class-feedback-header h3 {
        margin: 0 0 7px;
        color: var(--cr-text);
        font-size: 20px;
    }

    .tc-class-feedback-header p {
        margin: 0;
        color: var(--cr-muted);
        font-size: 14px;
    }


/* Stars */

.tc-class-rating {
    display: flex;
    direction: rtl;
    justify-content: center;
    gap: 7px;
    margin: 18px 0;
}

    .tc-class-rating input {
        display: none;
    }

    .tc-class-rating label {
        cursor: pointer;
        color: #d6dbe5;
        font-size: 32px;
        transition: .2s ease;
    }

        .tc-class-rating label:hover,
        .tc-class-rating label:hover ~ label,
        .tc-class-rating input:checked ~ label {
            color: #f59e0b;
            transform: scale(1.08);
        }


/* Form */

.tc-class-feedback-form {
    max-width: 700px;
    margin: 0 auto;
}

    .tc-class-feedback-form label {
        display: block;
        margin-bottom: 8px;
        color: var(--cr-text);
        font-weight: 700;
        font-size: 14px;
    }

    .tc-class-feedback-form textarea {
        width: 100%;
        min-height: 125px;
        resize: vertical;
        padding: 14px 16px;
        border: 1px solid var(--cr-border);
        border-radius: 15px;
        outline: none;
        color: var(--cr-text);
        background: #fafbfe;
        font-family: inherit;
        transition: .2s ease;
    }

        .tc-class-feedback-form textarea:focus {
            border-color: var(--cr-primary);
            background: #fff;
            box-shadow: 0 0 0 4px rgba(79,70,229,.08);
        }

.tc-class-feedback-submit {
    width: 100%;
    margin-top: 14px;
    padding: 13px 20px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--cr-primary), #7c3aed);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
}

    .tc-class-feedback-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 25px rgba(79,70,229,.25);
    }

.tc-class-feedback-message {
    display: none;
    margin-top: 14px;
    padding: 12px 15px;
    border-radius: 12px;
    text-align: center;
    background: #ecfdf3;
    color: #166534;
    font-size: 14px;
}


/* =========================================================
   Back
   ========================================================= */

.tc-class-rules-back {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 900px) {

    .tc-class-rules-highlights {
        grid-template-columns: 1fr;
    }

    .tc-class-rules-grid {
        grid-template-columns: 1fr;
    }

    .tc-class-rules-hero {
        padding: 25px;
    }

    .tc-class-rules-hero-content {
        align-items: flex-start;
    }

    .tc-class-rules-hero-icon {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
        font-size: 27px;
    }

    .tc-class-rules-hero h2 {
        font-size: 23px;
    }
}

@media (max-width: 576px) {

    .tc-class-rules-hero-content {
        flex-direction: column;
    }

    .tc-class-feedback {
        padding: 20px;
    }

    .tc-class-rating label {
        font-size: 27px;
    }
}
/* =========================================================
   CLASS RULES PAGE
   FIXED HEIGHT + INTERNAL SCROLL
   RESPONSIVE
   ========================================================= */

.tc-class-rules-page {
    width: 100%;
    max-width: 100%;
    height: calc(100vh - var(--ai-header-height, 190px));
    height: calc(100dvh - var(--ai-header-height, 190px));
    min-height: 0;
    overflow: hidden !important;
}


    /* ---------------------------------------------------------
   Main صفحه شرایط
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-ai-main {
        min-width: 0;
        min-height: 0;
        height: 100%;
        overflow: hidden !important;
    }


    /* ---------------------------------------------------------
   خود محتوا Scroll می‌شود
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-ai-messages {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        min-height: 0;
        height: auto;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        scroll-behavior: smooth;
        padding: 30px clamp(16px, 4vw, 65px) 45px;
        scrollbar-width: thin;
        scrollbar-color: rgba(99,102,241,.30) transparent;
    }


        /* Chrome / Edge / Safari */

        .tc-class-rules-page
        .tc-ai-messages::-webkit-scrollbar {
            width: 8px;
        }

        .tc-class-rules-page
        .tc-ai-messages::-webkit-scrollbar-track {
            background: transparent;
        }

        .tc-class-rules-page
        .tc-ai-messages::-webkit-scrollbar-thumb {
            border-radius: 20px;
            background: linear-gradient( 180deg, #6366f1, #8b5cf6 );
        }

            .tc-class-rules-page
            .tc-ai-messages::-webkit-scrollbar-thumb:hover {
                background: linear-gradient( 180deg, #4f46e5, #7c3aed );
            }


    /* ---------------------------------------------------------
   Grid
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-class-rules-grid {
        width: 100%;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }


    /* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-class-rules-hero {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto 22px;
    }


    /* ---------------------------------------------------------
   Highlights
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-class-rules-highlights {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto 25px;
    }


    /* ---------------------------------------------------------
   Notice
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-class-rules-notice {
        width: 100%;
        max-width: 1200px;
        margin: 25px auto;
    }


    /* ---------------------------------------------------------
   Feedback
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-class-feedback {
        width: 100%;
        max-width: 1200px;
        margin: 25px auto;
    }


    /* ---------------------------------------------------------
   Bottom buttons
   --------------------------------------------------------- */

    .tc-class-rules-page .tc-class-rules-back {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        width: 100%;
        max-width: 1200px;
        margin: 25px auto 10px;
    }


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .tc-class-rules-page .tc-ai-messages {
        padding: 24px 22px 40px;
    }

    .tc-class-rules-page .tc-class-rules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .tc-class-rules-page {
        height: calc(100vh - 70px);
        height: calc(100dvh - 70px);
    }

        .tc-class-rules-page .tc-ai-messages {
            padding: 16px 10px 35px;
            overflow-y: auto !important;
        }

        .tc-class-rules-page .tc-class-rules-hero {
            margin-bottom: 15px;
        }

        .tc-class-rules-page .tc-class-rules-highlights {
            grid-template-columns: 1fr;
            gap: 10px;
            margin-bottom: 18px;
        }

        .tc-class-rules-page .tc-class-rules-grid {
            grid-template-columns: 1fr;
            gap: 12px;
        }

        .tc-class-rules-page .tc-class-rule-card {
            width: 100%;
        }

        .tc-class-rules-page .tc-class-rules-notice {
            margin: 18px auto;
        }

        .tc-class-rules-page .tc-class-feedback {
            margin: 18px auto;
        }

        .tc-class-rules-page .tc-class-rules-back {
            flex-direction: column;
            align-items: stretch;
            gap: 9px;
        }

            .tc-class-rules-page .tc-class-rules-back a {
                width: 100%;
                justify-content: center;
            }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 430px) {

    .tc-class-rules-page {
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px);
    }

        .tc-class-rules-page .tc-ai-messages {
            padding: 12px 7px 30px;
        }
}