/**
 * Share Your Idea Modal - CSS Styles
 * شارك فكرتك - نموذج تقديم الأفكار
 * Version: 1.0
 */

/* ===== Modal Overlay ===== */
.share-idea-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.share-idea-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== Modal Content ===== */
.share-idea-modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 2px solid var(--border-color);
    margin: 40px auto;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Modal Header ===== */
.share-idea-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(42, 42, 42, 0.9));
    border-radius: 20px 20px 0 0;
}

.share-idea-modal-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin: 0;
    text-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}

.share-idea-modal-close {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.share-idea-modal-close:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    transform: rotate(90deg);
}

/* ===== Modal Body ===== */
.share-idea-modal-body {
    padding: 30px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
}

.share-idea-modal-body::-webkit-scrollbar {
    width: 8px;
}

.share-idea-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.share-idea-modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

/* ===== Form Sections ===== */
.idea-form-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.idea-form-section:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-icon {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.section-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin: 0;
}

/* ===== Form Layout ===== */
.idea-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.idea-form-row.three-cols {
    grid-template-columns: 1fr 1fr 1fr;
}

.idea-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.idea-form-group.full-width {
    grid-column: 1 / -1;
    width: 100%;
}

.idea-form-label {
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.idea-required {
    color: #DC143C;
    font-size: 1rem;
}

/* ===== Form Controls ===== */
.idea-form-control {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.idea-form-control:focus {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(201, 169, 97, 0.1);
}

.idea-form-control::placeholder {
    color: var(--text-muted);
}

select.idea-form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C9A961' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    padding-left: 40px;
}

textarea.idea-form-control {
    resize: vertical;
    min-height: 100px;
    max-height: 300px;
    line-height: 1.6;
}

/* Ensure full width for textareas in full-width containers */
.idea-form-group.full-width textarea.idea-form-control {
    width: 100%;
    box-sizing: border-box;
}

/* ===== Phone Input Wrapper ===== */
.idea-phone-wrapper {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
}

.idea-phone-code {
    flex: 0 0 120px;
    padding-left: 35px;
    direction: ltr;
    text-align: left;
}

.idea-phone-number {
    flex: 1;
}

/* ===== Character Counter ===== */
.char-counter-wrapper {
    position: relative;
    width: 100%;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    left: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    pointer-events: none;
}

.char-counter.near-limit {
    color: #FFA500;
}

.char-counter.at-limit {
    color: #DC143C;
    font-weight: 700;
}

/* ===== Characters Table ===== */
.characters-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.characters-table thead th {
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-align: right;
    padding: 10px;
    background: rgba(201, 169, 97, 0.1);
    border: 1px solid var(--border-color);
}

.characters-table thead th:first-child {
    border-radius: 0 8px 8px 0;
}

.characters-table thead th:last-child {
    border-radius: 8px 0 0 8px;
}

.idea-characters-table thead th {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-align: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.idea-characters-table tbody td {
    padding: 10px;
    border: 1px solid var(--border-color);
}

.idea-characters-table input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    outline: none;
    padding: 5px;
}

/* Character table action buttons */
.char-delete-btn {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #FF6347 100%);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.char-delete-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.5);
}

.char-delete-btn:active {
    transform: scale(0.95);
}

/* Character table add button - Custom large gold button */
.idea-characters-table+.add-char-btn {
    width: 100%;
    margin-top: 5px;
    padding: 15px;
    background: linear-gradient(135deg, #C9A961 0%, #A68948 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.3);
}

.idea-characters-table+.add-char-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 169, 97, 0.5);
    background: linear-gradient(135deg, #D4B97C 0%, #B69A57 100%);
}

.idea-characters-table+.add-char-btn:active {
    transform: translateY(0);
}

.idea-characters-table+.add-char-btn i {
    font-size: 1.2rem;
}

/* ===== Declaration Section (إقرار مقدم المحتوى) ===== */
.declaration-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    transition: all 0.3s ease;
}

.declaration-wrapper:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
}

.declaration-wrapper input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.declaration-wrapper label {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    color: var(--accent-primary);
    margin: 0;
    cursor: pointer;
    display: flex;
    gap: 8px;
    font-weight: 600;
}

.declaration-wrapper label a {
    color: #ffffff;
    text-decoration: underline;
}

/* ===== Modal Footer ===== */
.share-idea-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 20px 20px;
}

.idea-btn {
    padding: 12px 35px;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 12px;
    border: none;
}

.idea-btn-cancel {
    background: transparent;
    border: 1px solid #C9A961;
    color: #ffffff;
}

.idea-btn-cancel:hover {
    background: rgba(201, 169, 97, 0.1);
    transform: translateY(-2px);
}

.idea-btn-submit {
    background: linear-gradient(135deg, #C9A961 0%, #A68948 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.3);
}

.idea-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 169, 97, 0.5);
    background: linear-gradient(135deg, #D4B97C 0%, #B69A57 100%);
}

.idea-btn-submit:active {
    transform: translateY(0);
}

.idea-btn i {
    font-size: 0.9rem;
}

/* ===== Success Message ===== */
.idea-success-message {
    display: none;
    text-align: center;
    padding: 60px 40px;
}

.idea-success-message.active {
    display: block;
}

.idea-success-message i {
    font-size: 5rem;
    color: var(--accent-primary);
    margin-bottom: 20px;
    animation: successPulse 1s ease infinite;
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.idea-success-message h3 {
    font-family: 'Cairo', sans-serif;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.idea-success-message p {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .share-idea-modal-content {
        margin: 20px auto;
    }

    .share-idea-modal-header {
        padding: 20px;
    }

    .share-idea-modal-title {
        font-size: 1.4rem;
    }

    .share-idea-modal-body {
        padding: 20px;
        max-height: calc(90vh - 180px);
    }

    .idea-form-section {
        padding: 20px;
    }

    .idea-form-row,
    .idea-form-row.three-cols {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .share-idea-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }

    .idea-btn {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .section-icon {
        font-size: 1.3rem;
    }

    .characters-table {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .share-idea-modal {
        padding: 0 !important;
        align-items: flex-start !important;
    }

    .share-idea-modal-content {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .share-idea-modal-header {
        flex-shrink: 0;
        padding: 15px !important;
    }

    .share-idea-modal-title {
        font-size: 1.3rem !important;
    }

    .share-idea-modal-body {
        padding: 15px !important;
        flex: 1 !important;
        max-height: none !important;
        /* Let flex handle height */
        overflow-y: auto !important;
    }

    /* Adjust Form elements for small screens */
    .section-title {
        font-size: 1rem;
    }

    .idea-form-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .idea-form-label {
        font-size: 0.85rem;
    }

    .idea-form-control {
        font-size: 0.85rem;
        padding: 10px 14px;
    }
}