/* X Raids page styles */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Grid Layout */
.x-raid-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

/* Grid Items */
.grid-item {
    display: flex;
    flex-direction: column;
}

/* Row 1, Column 1: Image Section */
.image-section {
    grid-row: 1;
    grid-column: 1;
}

/* Row 1, Column 2: Text Section */
.text-section {
    grid-row: 1;
    grid-column: 2;
}

/* Row 2, Columns 1-2: Share Section */
.share-section {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: solid 1px #d3d3d3;
    PADDING: 5px;
    border-radius: 20px;
    background: #ffffff;
}

/* Row 4, Columns 1-2: Ad Section */
.ad-section {
    grid-row: 3;
    grid-column: 1 / -1;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 10px;
        max-width: 100%;
    }
    
    .x-raid-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 100%;
        margin: 0;
    }
    
    .image-section {
        grid-row: 1;
        grid-column: 1;
    }
    
    .text-section {
        grid-row: 2;
        grid-column: 1;
    }
    
    .share-section {
        grid-row: 3;
        grid-column: 1;
    }
    
    .helper-section {
        grid-row: 4;
        grid-column: 1;
    }
    
    .ad-section {
        grid-row: 5;
        grid-column: 1;
    }
    
    /* Ensure cards fit within viewport */
    .tweet-card {
        max-width: 100%;
        margin: 0;
    }
    
    .media-wrap {
        min-height: 200px;
        aspect-ratio: 16 / 9;
    }
    
    .text-wrap {
        min-height: 200px;
    }
    
    .copypasta {
        min-height: 150px;
        font-size: 1rem;
    }
    
    /* Responsive share section */
    .share-row {
        flex-direction: column;
        gap: 12px;
        max-width: 100%;
    }
    
    .share-url {
        max-width: 100%;
        word-break: break-all;
    }
}

/* Tweet Cards */
.tweet-card { 
    width: 100%; 
    background: #fff; 
    border-radius: 12px; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.08); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
}

.media-wrap { 
    position: relative; 
    background: #f5f5f7; 
    aspect-ratio: 16 / 9; 
    min-height: 300px; 
}

.media-wrap .meme-image { 
    width: 100%; 
    height: 100%; 
    display: block; 
    object-fit: cover; 
}

.text-wrap { 
    position: relative; 
    padding: 0; 
    flex: 1 1 auto; 
    min-height: 300px; 
    display: flex; 
    align-items: flex-start; 
}

/* Share and Helper sections styling */
.share-wrap { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
}

.share-row { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    max-width: 500px; 
    width: 100%; 
    justify-content: center; 
}

.share-url { 
    display: block; 
    max-width: 350px; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    padding: 8px 12px; 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.08); 
}

.helper-note { 
    text-align: center; 
    width: 100%; 
}

.helper-note .small { 
    max-width: 500px; 
    margin: 0 auto; 
    display: block; 
}

/* hide side column */
.side-column { display: none; }

.copypasta-panel { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.08); position: sticky; top: 16px; }
.copypasta-panel .panel-header { font-weight: 700; margin-bottom: 8px; opacity: 0.8; }
.copypasta { 
    font-size: 1.25rem; 
    line-height: 1.5; 
    white-space: pre-wrap; 
    padding: 12px; 
    font-family: 'Roboto Condensed', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    width: 100%;
    border: 2px solid transparent;
    outline: none;
    resize: vertical;
    color: inherit;
    min-height: 200px;
    border-radius: 8px;
    transition: all 0.2s ease;
    caret-color: #2563EB;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Blinking cursor animation when empty */
.copypasta:empty::before,
.copypasta[value=""]:not(:focus)::after {
    content: "|";
    color: #2563EB;
    animation: blink 1s infinite;
    position: absolute;
    pointer-events: none;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Loading state styling */
.copypasta:disabled {
    background: rgba(243, 244, 246, 0.8);
    color: #6b7280;
    cursor: not-allowed;
    border-color: transparent;
}

/* Selection styling */
.copypasta::selection {
    background: rgba(37, 99, 235, 0.2);
}

/* Text wrap container for positioning edit indicator */
.text-wrap {
    position: relative;
}

/* Edit indicator */
.text-wrap::after {
    content: "✏️";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s ease;
}

.text-wrap:hover::after {
    opacity: 0.9;
}

/* Hide edit indicator when textarea is focused */
.copypasta:focus + .edit-indicator,
.text-wrap:has(.copypasta:focus)::after {
    opacity: 0;
}

/* Controls row below cards */
.controls-row { 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    padding: 10px 12px; 
    border-top: 1px solid rgba(0,0,0,0.06); 
    background: #fff; 
}

.helper-note { 
    grid-column: 1 / -1; 
    width: 100%; 
    padding: 8px 16px; 
}

.helper-note .small { 
    display: block; 
    max-width: 840px; 
    margin: 0 auto; 
}

/* Image section controls - align left */
.image-section .controls-row {
    justify-content: flex-start;
}

/* Text section controls - align right */
.text-section .controls-row {
    justify-content: flex-end;
}

/* Mobile responsive - center align all controls */
@media (max-width: 900px) {
    .image-section .controls-row,
    .text-section .controls-row {
        justify-content: center;
    }
    
    /* Ensure buttons don't overflow */
    .controls-row {
        flex-wrap: wrap;
        padding: 8px 10px;
    }
    
    .btn {
        font-size: 1rem;
        padding: 0.5rem;
    }
}

.loading { padding: 12px; color: #666; }
.error { color: #b00020; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: rgba(0,0,0,0.85); color: #fff; padding: 10px 14px; border-radius: 8px; transition: 150ms ease; pointer-events: none; z-index: 9999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.page-header {
    margin-bottom: 20px;
}

.card-column.content .btn {
    background-color: #a9e4ff
}

#shareUrl{
    color:#006797;
}

/* Telegram advertisement */
.advertisement {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.telegram-ad {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
    color: white !important;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.telegram-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.telegram-ad i {
    font-size: 1.2em;
}

/* Copy URL button disabled state */
#copyUrlBtn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}
.btn {
    background: transparent;
    padding: 0.5rem;
    font-size: 1.1rem;
    color: #b60303;
}

.text-section .btn {
    color: #0099c4;
}

.share-row .btn {
    font-size: 0.8rem;
    color: #1e1e1e;
}