﻿/* ===== ENHANCED COLOR VARIABLES ===== */
:root {
    --q-box-shadow: var(--shadow);
    --focus-glow: 0 0 0 3px rgba(93, 78, 71, 0.15);
    --success-light: rgba(74, 120, 101, 0.1);
    --site-red-light: rgba(140, 43, 14, 0.1);
    --site-red-lighter: rgba(140, 43, 14, 0.05);
}

/* ===== ENHANCED CONTAINER STYLES ===== */
.partial-container {
    direction: rtl;
    margin: var(--space-xl) auto 0;
    background-image: var(--default-bg-image);
    background-color: var(--main-bg-color);
    background-blend-mode: multiply;
    border-radius: var(--border-radius);
    border-top-right-radius: 0 !important;
    border-top-left-radius: 0 !important;
    overflow: visible;
    box-shadow: var(--q-box-shadow);
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-light);
    border-top: none;
}

    .partial-container::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--rich-gold), transparent);
        z-index: 2;
    }

/* ===== ENHANCED HEADER STYLES ===== */

.partial-header {
    text-align: center;
    padding: var(--space-xs);
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    /*border-bottom: 1px solid var(--border-light);*/
}
    .partial-header::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 20%;
        right: 20%;
        height: 1px;
        /*background: linear-gradient(90deg, transparent, var(--success-50), transparent);*/
        border-radius: 2px;
    }

    .partial-header h3 {
        font-size: var(--text-xl);
        color: var(--primary);
        margin-bottom: var(--space-sm);
        font-weight: var(--font-bold);
        line-height: var(--leading-display);
    }

        .partial-header h3 .highlight {
            color: var(--site-red);
            font-weight: var(--font-bold);
        }

/* ===== ENHANCED TEXTAREA STYLES ===== */
.partial-textarea-container {
    position: relative;
    margin: var(--space-lg) var(--space-lg) var(--space-sm);
}

.partial-textarea-header {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: var(--space-xs);
}

    .partial-textarea-header label {
        font-size: var(--text-sm);
        color: var(--primary);
        font-weight: var(--font-semibold);
        margin-left: var(--space-xs);
    }

#q-txt-area {
    width: 100%;
    height: 160px;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    resize: vertical;
    font-size: var(--text-base);
    transition: var(--transition);
    text-align: right;
    direction: rtl;
    font-family: var(--font-primary);
    background-color: var(--secondary-bg);
    display: block;
    line-height: var(--leading-normal);
    font-size: var(--text-sm);
}

    #q-txt-area:focus {
        outline: none;
        border-color: var(--secondary);
        box-shadow: var(--focus-glow);
        background-color: var(--light);
    }

/* ===== ENHANCED CATEGORY SECTION STYLES ===== */
.partial-category-section {
    display: flex;
    flex-wrap: wrap;
    margin: 0 var(--space-lg) var(--space-lg);
    text-align: right;
    gap: var(--space-md);
    position: relative;
    align-items: center;
    justify-content: start;
    padding: var(--space-sm);
    border-radius: var(--border-radius);
}

.partial-category-header {
    display: flex;
    margin-bottom: 0;
    justify-content: center;
    align-items: center;
    flex: 1;
}

    .partial-category-header h5 {
        font-size: var(--text-base);
        color: var(--success-800);
        margin: 0;
        margin-right: var(--space-xs);
        font-weight: var(--font-semibold);
        white-space: nowrap;
    }

.partial-category-select {
    position: relative;
    display: inline-block;
    justify-content: center;
    flex: 2;
}

.partial-category-header,
.partial-category-select {
    min-width: 121px;
    max-width: 121px;
}

    .partial-category-select select {
        width: 100%;
        padding: var(--space-sm) 30px var(--space-sm) var(--space-md);
        border: 1px solid var(--border);
        border-radius: var(--border-radius);
        background-color: var(--light);
        font-size: var(--text-base);
        color: var(--dark);
        appearance: none;
        cursor: pointer;
        transition: var(--transition);
        text-align: right;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 4px center;
    }

        .partial-category-select select:focus {
            border-color: var(--secondary);
            box-shadow: var(--focus-glow);
            outline: none;
        }

/* ===== ENHANCED BUTTON STYLES ===== */
.partial-buttons-container {
    display: flex;
    justify-content: space-between;
    margin: var(--space-lg);
    gap: var(--space-md);
}

.partial-question-btn {
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    flex: 1;
    max-width: 64%;
}

#btn-cont {
    background: linear-gradient(to right, var(--success), var(--success-dark));
    color: var(--light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    #btn-cont:hover {
        background: linear-gradient(to right, var(--site-red), var(--site-red-700));
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

#btn-clr {
    background-color: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
    text-decoration: none;
}

    #btn-clr:hover {
        background-color: var(--site-red);
        border-color: var(--site-red);
        color: var(--light);
        transform: translateY(-2px);
    }

/* ===== ENHANCED LINK STYLES ===== */
.partial-styled-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin: var(--space-lg);
    padding: var(--space-sm);
    background-color: var(--site-red-light);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--site-red-700);
    font-weight: var(--font-semibold);
    transition: var(--transition);
    text-align: center;
    border: 1px solid var(--site-red-300);
    flex-wrap: nowrap;
    width: auto;
}

    .partial-styled-link:hover {
        background-color: var(--site-red-lighter);
        transform: translateY(-2px);
        color: var(--site-red);
    }

    .partial-styled-link img {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }

/* ===== ENHANCED TOOLTIP & HELP STYLES ===== */
.partial-tooltip .emphasize {
    color: var(--rich-gold);
    font-weight: var(--font-medium);
}

.partial-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: var(--space-xs);
}

.partial-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: var(--secondary-bg);
    color: var(--secondary);
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    transition: var(--transition);
    z-index: 2;
    border: 1px solid var(--border);
}

.partial-help:hover .partial-help-icon {
    background-color: var(--secondary);
    color: var(--light);
    transform: scale(1.05);
}

.partial-tooltip {
    position: absolute;
    background-color: var(--dark);
    color: var(--light);
    padding: var(--space-md);
    border-radius: var(--border-radius);
    font-size: var(--text-sm);
    box-shadow: var(--q-box-shadow);
    z-index: 1000;
    text-align: right;
    line-height: var(--leading-normal);
    max-width: 400px;
    width: max-content;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    bottom: 100%;
    right: 0;
    border: 1px solid var(--border-dark);
}

.partial-header-help .partial-tooltip {
    right: initial;
    left: 0;
}

.partial-help:hover .partial-tooltip,
.partial-help.active .partial-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ===== RESPONSIVE STYLES ===== */

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .partial-header h3 {
        font-size: var(--text-2xl);
    }

    .partial-category-header h5 {
        font-size: var(--text-base);
    }

    .partial-category-select select {
        font-size: var(--text-sm);
    }
}

/* Medium devices (tablets, 768px and down) */
@media (max-width: 768px) {
    .partial-header h3 {
        font-size: var(--text-lg);
    }

    .partial-question-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--text-sm);
    }

    #btn-clr {
        font-size: var(--text-xs);
    }

    .partial-header,
    .partial-intro,
    .partial-textarea-container,
    .partial-category-section,
    .partial-buttons-container,
    .partial-styled-link {
        margin-left: var(--space-sm);
        margin-right: var(--space-sm);
    }

    .partial-category-select select {
        padding: var(--space-xs) 27px var(--space-xs) 0;
    }

    .partial-styled-link {
        font-size: var(--text-base);
        margin: var(--space-md);
        padding: var(--space-xs);
    }

    .partial-tooltip {
        font-size: var(--text-base);
        padding: var(--space-sm);
    }
}

/* Small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .partial-header h3 {
        font-size: var(--text-base);
        margin-left: var(--space-xs);
    }

    .partial-header {
        padding: var(--space-md) 0;
    }

    .partial-category-section {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    .partial-category-header {
        justify-content: flex-start;
        min-width: 100%;
        max-width: 100%;
        margin-bottom: var(--space-xs);
    }

        .partial-category-header h5 {
            font-size: var(--text-sm);
            margin-right: 0;
        }

    .partial-category-select {
        min-width: 100%;
        max-width: 100%;
    }

        .partial-category-select select {
            padding: var(--space-xs) 27px var(--space-xs) 0;
            width: 100%;
        }

    #q-txt-area {
        height: 121px;
        padding: var(--space-md) var(--space-xs);
    }

    .partial-styled-link {
        font-size: var(--text-xs);
        margin: 0;
        padding: var(--space-xs);
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
    }

        .partial-styled-link img {
            width: 24px;
            height: 24px;
        }

    .partial-question-btn {
        padding: var(--space-xs);
        font-size: var(--text-sm);
        max-width: 100%;
    }

    .partial-help {
        margin-right: 0;
        margin-left: var(--space-xs);
    }

    .partial-tooltip {
        font-size: var(--text-xs);
        padding: var(--space-xs);
        max-width: 280px;
    }

    .partial-header-help .partial-tooltip {
        right: initial;
    }
}

/* Extra small devices (414px and down) */
@media (max-width: 414px) {
    .partial-question-btn {
        font-size: var(--text-xs);
    }

    .partial-category-header h5 {
        font-size: var(--text-xs);
    }

    .partial-category-section {
        justify-content: center;
    }

    .partial-tooltip {
        max-width: 250px;
    }

    .partial-header-help .partial-tooltip {
    }
}
