:root {
    --color-primary: #a24242;
    /* Blue-500 */
    --color-primary-dark: #8b1f1f;
    /* Blue-600 */
    --color-secondary: #666666
    /* Gray-600 */;
    --color-secondary-dark: #4b4b4b;
    /* Gray-700 */
    --color-text-dark: #1f2937;
    /* Gray-800 */
    --color-text-medium: #6b7280;
    /* Gray-500 */
    --color-bg-light: #f9fafb;
    /* Gray-50 */
    --color-border: #d1d5db;
    /* Gray-300 */
}

/* Base Layout and Container */
.arguments-section-holder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

.arguments-section-wrapper {
    width: 100%;
    max-width: 672px;
    /* Equivalent to max-w-2xl */
}

/* Header and Post Area Wrapper */
.header-post-wrapper {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    background-color: #ffffff;
    border-radius: 3px;
    box-shadow: var(--white_card_shadow);
}

.section-header {
    font-size: 1.25rem;
    /* text-xl */
    font-weight: bold;
    color: var(--color-text-dark);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.arguments-title-option-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.arguments-option-text {
    font-size: 0.875rem;
    /* text-sm */
    color: var(--color-text-medium);
    display: inline-block;
}

.arguments-option {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.arguments-count {
    font-size: 0.875rem;
    /* text-sm */
    color: var(--color-text-medium);
    margin-left: 8px;
}

.text-area-holder {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 8px;
}


/* Post Argument Form */
.post-argument-form {
    display: flex;
}


.profile-image {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.text-input-container {
    width: 80%;
    position: relative;
    flex-grow: 1;
}

.editor_imageuploadpreviewwrapper {
    margin-left: 0;
    margin-top: 1rem;
}

.post-argument-text {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    min-height: 50px;
    height: fit-content;
    outline: none;
}

.post-argument-text:focus {
    border-color: var(--color-secondary);
    min-height: 65px;
}


.editornavbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}


.postargumenttext-textarea {
    margin-top: 40px;
    width: 100%;
    min-height: 80px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    font-family: 'Inter', sans-serif;
}


/* Logged Out State Styling */
.post-argument-text.sign-in-prompt {
    background-color: var(--color-bg-light);
    color: #9ca3af;
    /* Gray-400 */
}

/* Form Feedback and Button */
.post-feedback {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 8px;
}

.postfeedbackbuttons {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.char-remaining {
    font-size: 0.75rem;
    /* text-xs */
    color: var(--color-text-medium);
    margin-right: 16px;
}

.post-argument-button {
    font-size: 0.875rem;
    /* text-sm */
    color: white;
    background-color: var(--color-secondary);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    min-width: 80px;
    padding: 0 10px;
    height: 30px;
    text-align: center;
    display: flex;
    transition: background-color 0.2s;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.post-argument-button:hover:not(:disabled) {
    background-color: var(--color-secondary-dark);
}

.post-argument-button:disabled {
    background-color: #9ca3af;
    /* Gray-400 */
    cursor: not-allowed;
}

/* Argument List Items */
.argument-item {
    padding: 16px;
    margin-bottom: 16px;
    background-color: #ffffff;
    border-radius: 3px;
    box-shadow: var(--white_card_shadow);
}

/* Collapsed Argument State */
.argument-collapsed .argument-item-header,
.argument-collapsed .argument-image,
.argument-collapsed .argument-actions {
    display: none;
}

.collapse-placeholder {
    display: none;
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    background-color: #d1d3d4;
    border-radius: 3px;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease;
}

.collapse-placeholder:hover {
    background-color: #dddddd;
    color: #4b5563;
}

.argument-collapsed .collapse-placeholder {
    display: block;
}

/* Gray background for arguments that were collapsed but are now expanded */
.argument-was-collapsed:not(.argument-collapsed) {
    background-color: #f3f4f6;
}


/* Revised Argument Header */
.argument-item-header {
    width: 100%;
    margin-bottom: 0.5rem;
    position: relative;
}

.argument-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.argument-user-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    width: fit-content;
}

.profile-image-holder {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.argument-content-area {
    width: 100%;
    flex-grow: 1;
}


/* .argument-info removed - defined above */

.user-name {
    font-weight: bold;
    color: #666666;
    font-size: 14px;
}

.argument-text {
    font-size: 14px;
    margin-top: 0.5rem;
    color: #666666;
}

/* Argument flags   */
.argument-flag-popup {
    position: absolute;
    width: 70%;
    min-width: fit-content;
    top: -2px;
    right: 0;
    background-color: white;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.argument-flag-popup-content {
    position: relative;
    width: 100%;
    padding: 8px;
    font-size: 0.875rem;
    color: var(--color-text-dark);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input[type="checkbox"] {
    accent-color: #a24242;
    /* Primary color */
    border: 1px solid #ddd;
}

/* Force visibility for rejection popup inputs */
.argument-flag-popup-content input[type="checkbox"] {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-right: 5px;
}


.argument-flag-popup-content > .close-button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--color-text-medium);
}

.argument-flag-popup-content > .flag-button {
    padding: 6px 12px;
    width: fit-content;
    background-color: var(--color-secondary);
    margin-left: auto;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.argument-flag-popup-content > .delete-button {
    padding: 6px 12px;
    width: fit-content;
    background-color: #ef4444;
    /* Red-500 */
    margin-left: auto;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.argument-flag-popup-content > .flag-reasons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.argument-flag-popup-content > .flag-reasons > label {
    font-size: 12px;
    color: #666666;
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.argument-flag-popup-content > .reject-reasons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.argument-flag-popup-content > .reject-reasons > label {
    font-size: 12px;
    color: #666666;
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.argument-flag-popup-content > .reject-submit-button {
    padding: 6px 12px;
    width: fit-content;
    background-color: #a24242;
    /* Red for rejection */
    margin-left: auto;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.argument-flag-popup-content > .reject-submit-button:hover {
    opacity: 0.8;
}

/* Edit/Delete buttons and countdown timer */
.argument-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

.argument-actions-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.argument-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.argument-owner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-button,
.delete-button,
.collapse-button,
.save-edit-button,
.cancel-edit-button {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.collapse-button {
    background-color: #6b7280;
    color: white;
}

.collapse-button:hover {
    background-color: #4b5563;
}

.collapse-all-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background-color: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 8px;
    transition: background-color 0.2s;
}

.collapse-all-btn:hover {
    background-color: #4b5563;
}

.edit-button {
    background-color: #666666;
    color: white;
}

.edit-button:hover {
    background-color: #666666;
}

.delete-button {
    background-color: #a24242;
    color: white;
}

.delete-button:hover {
    background-color: #a24242;
}

.save-edit-button {
    background-color: #10b981;
    color: white;
}

.save-edit-button:hover {
    background-color: #059669;
}

.cancel-edit-button {
    background-color: #6b7280;
    color: white;
}

.cancel-edit-button:hover {
    background-color: #4b5563;
}

.edit-countdown {
    margin-left: auto;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    background-color: #ffffff;
    border: 1px solid #666666;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.edit-argument-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    border: 2px solid #666666;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 8px;
}

.edit-argument-textarea:focus {
    outline: none;
    border-color: #a24242;
}

.action-button {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: var(--color-text-medium);
}

.action-button svg {
    width: 16px;
    height: 16px;
    margin-right: 2px;
}

.arguments-like-button > svg path:last-child {
    fill: #666666;
}

.arguments-dislike-button > svg path:last-child {
    fill: #666666;
}

.arguments-likes-count {
    transition: color 0.1s;
    font-size: 0.875rem;
    color: var(--color-text-medium);
}

.arguments-dislikes-count {
    transition: color 0.1s;
    font-size: 0.875rem;
    color: var(--color-text-medium);
}

.arguments-like-button:hover > svg path:last-child {
    fill: #10b981;
}

.arguments-like-button:hover > .arguments-likes-count {
    color: #10b981;
}

.arguments-dislike-button:hover > svg path:last-child {
    fill: #ef4444;
    /* Red-500 */
}

.arguments-dislike-button:hover > .arguments-dislikes-count {
    color: #ef4444;
    /* Red-500 */
}

/* Active state for liked arguments - use hover color */
.arguments-like-button.arguments-liked > svg path:last-child {
    fill: #10b981;
}

.arguments-like-button.arguments-liked > .arguments-likes-count {
    color: #10b981;
}

/* Active state for disliked arguments - use hover color */
.arguments-dislike-button.arguments-disliked > svg path:last-child {
    fill: #ef4444;
    /* Red-500 */
}

.arguments-dislike-button.arguments-disliked > .arguments-dislikes-count {
    color: #ef4444;
    /* Red-500 */
}

/* Rejection Button Styling */
.reject-icon {
    fill: #6b7280;
    stroke: #6b7280;
    transition: fill 0.2s, stroke 0.2s;
}

.arguments-reject-button:hover .reject-icon,
.arguments-reject-button.arguments-rejected .reject-icon {
    fill: #ef4444;
    /* Red-500 */
    stroke: #ef4444;
}

.arguments-reject-button:hover .arguments-rejections-count,
.arguments-reject-button.arguments-rejected .arguments-rejections-count {
    color: #ef4444;
}


/* Load More Button */

.loadmore-arguments-button-holder {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    background-color: var(--light_btn_color);
    border-radius: 3px;
    transition: var(--btn_bgcolor_animation);
}

.loadmore-arguments-button-holder:hover {
    background-color: var(--light_btn_hover_color);
}

.loadmore-arguments-button {
    font-size: 14px;
    color: #666666;
}


/* Dropdown Menu */
.dropdown-menu {
    position: relative;
    display: inline-block;
    text-align: left;
}

.dropdown-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 4px 8px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    color: var(--color-text-medium);
    cursor: pointer;
    outline: none;
    border: 1px solid transparent;
    transition: background-color 0.1s;
}

.dropdown-button:hover {
    background-color: var(--color-bg-light);
}

.dropdown-content {
    position: absolute;
    right: 0;
    margin-top: 8px;
    width: 224px;
    border-radius: 6px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    background-color: white;
    z-index: 10;
    padding: 4px 0;
}

.dropdown-content .menu-item {
    display: block;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #374151;
    /* Gray-700 */
    text-decoration: none;
    transition: background-color 0.1s;
}

.dropdown-content .menu-item:hover {
    background-color: var(--color-bg-light);
}

.hidden {
    display: none !important;
}

/* Placeholder text for contenteditable */
[contenteditable]:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
    display: block;
    /* For modern browsers */
}

/* Utility for text alignment */
.text-center {
    text-align: center;
}

.p-4 {
    padding: 16px;
}

.argument-no-argument {
    text-align: center;
    color: #666666;
    font-size: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Argument Image Styling - Bigger and better cropped like update images */
.argument-image {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    justify-content: center;
    overflow: hidden;
}

.argument-image > div {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: fit-content;
    min-height: 20rem;
    overflow: hidden;
}

.argumentimageiframe {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* For uploaded RML images - make bigger and crop perfectly */
.argument-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* For images with padding (getty, giphy, gfycat) - ensure proper sizing */
.argument-image > div[style*="padding-top"] {
    height: 0;
    min-height: 0;
}

/* GIF player in arguments */
.argument-image .gifplayer {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Instagram embeds in arguments */
.argument-image iframe.instagram-media,
.argument-image blockquote.instagram-media {
    position: relative !important;
    margin: 0 !important;
    min-width: unset !important;
    width: 100%;
    max-width: 100%;
}

@media only screen and (max-width: 768px) {
    .arguments-section-wrapper {
        max-width: 100%;
    }

    .text-area-holder {
        flex-direction: column;
    }

    .text-input-container {
        width: 100%;
    }

    .header-post-wrapper {
        padding: 0.8rem 0.5rem;
    }

    .char-remaining {
        margin-right: 0;
    }

    .postfeedbackbuttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .argument-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .argument-text {
        margin-top: 0.5rem;
    }

    .argument-actions-right .argument-actions-left {
        gap: 0.5rem;
    }

    /*  Editor Icons  */
    .editoricons .boldbtn {
        width: 26px;
        height: 26px;
        background-image: url(../assets/spritesv2/common.png);
        background-size: 360px 800px;
        background-position: -202px -282px;
    }

    .editoricons .italicbtn {
        width: 26px;
        height: 26px;
        background-image: url(../assets/spritesv2/common.png);
        background-size: 360px 800px;
        background-position: -202px -322px;
    }

    .editoricons .underlinebtn {
        width: 26px;
        height: 26px;
        background-image: url(../assets/spritesv2/common.png);
        background-size: 360px 800px;
        background-position: -202px -362px;
    }

    .editoricons .imagesbtn {
        width: 26px;
        height: 26px;
        background-image: url(../assets/spritesv2/common.png);
        background-size: 360px 800px;
        background-position: -202px -482px;
    }

    .editoricons .emojibtn {
        width: 26px;
        height: 26px;
        background-image: url(../assets/spritesv2/common.png);
        background-size: 360px 800px;
        background-position: -202px -522px;
    }

    .text-area-holder > .profile-image-holder {
        display: none;
    }

    .post-argument-button {
        width: 45px;
        height: 25px;
        padding: 0;
    }

    .argument-flag-popup-content {
        margin-top: 0.8rem;
    }

    .argument-flag-popup-content > .close-button {
        top: -0.5rem;
        font-size: 0.875rem;
    }

    .argument-flag-popup-content > .flag-button {
        padding: 4px 8px;
        font-size: 0.875rem;
    }

    .argument-flag-popup-content > .delete-button {
        padding: 4px 8px;
        font-size: 0.875rem;
    }

    /* Skeleton Loading Animation */
    .skeleton-argument-item {
        opacity: 0.7;
        pointer-events: none;
    }

    .skeleton-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: skeleton-loading 1.5s ease-in-out infinite;
    }

    .skeleton-line {
        height: 12px;
        border-radius: 4px;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: skeleton-loading 1.5s ease-in-out infinite;
        margin-bottom: 8px;
    }

    .skeleton-username {
        width: 100px;
        height: 14px;
        margin-bottom: 4px;
    }

    .skeleton-time {
        width: 60px;
        height: 12px;
        margin-left: auto;
    }

    .skeleton-text-1 {
        width: 100%;
        height: 12px;
        margin-top: 8px;
    }

    .skeleton-text-2 {
        width: 80%;
        height: 12px;
    }

    .skeleton-button {
        width: 50px;
        height: 24px;
        border-radius: 4px;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: skeleton-loading 1.5s ease-in-out infinite;
        display: inline-block;
        margin-right: 1rem;
    }

    @keyframes skeleton-loading {
        0% {
            background-position: 200% 0;
        }

        100% {
            background-position: -200% 0;
        }
    }

    .loading-arguments {
        text-align: center;
        padding: 20px;
        color: var(--color-text-medium);
        font-size: 14px;
    }

    .argument-image > div {
        height: fit-content;
        min-height: 10rem;
    }

}

/* Privacy Toggle Styling */
.argument-privacy-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.privacy-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.selected-privacy-display {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
    transition: background-color 0.2s;
    border: 1px solid transparent;
}

.selected-privacy-display:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: var(--color-border);
}

.selected-privacy-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.privacy-buttons-container {
    position: absolute;
    bottom: 30px;
    right: 0;
    background-color: white;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 100;
    min-width: 160px;
    padding: 4px 0;
    overflow: hidden;
}

.privacy-option-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    gap: 10px;
}

.privacy-option-row:hover {
    background-color: var(--color-bg-light);
}

.privacy-option-icon .option-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.privacy-option-name {
    font-size: 12px;
    color: var(--color-text-dark);
    white-space: nowrap;
    font-weight: 500;
}

/* Adjustments for the post form */
.postfeedbackbuttons .argument-privacy-wrapper {
    margin-left: auto;
    margin-right: 12px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .privacy-buttons-container {
        right: -50px;
        /* Center it more on mobile if needed */
    }
}