/* 
   💬 APEX PREMIUM COMMENT SYSTEM - "TikTok Style" V3.1
   Ultra-High performance, GPU-accelerated, Premium Aesthetics
*/

:root {
    --acs-primary: #ec4899;
    --acs-bg: #0a0a0f;
    --acs-surface: rgba(28, 28, 35, 0.95);
    --acs-border: rgba(255, 255, 255, 0.1);
    --acs-text: #ffffff;
    --acs-text-dim: rgba(255, 255, 255, 0.6);
}

/* --- THE SHEET --- */
#apex-comment-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#apex-comment-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#apex-comment-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85vh;
    background: var(--acs-bg);
    background: linear-gradient(180deg, var(--acs-surface) 0%, var(--acs-bg) 100%);
    border-radius: 35px 35px 0 0;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8);
    border-top: 1px solid var(--acs-border);
    overflow: hidden;
}

#apex-comment-sheet.active {
    transform: translateY(0);
}

/* --- HEADER --- */
.acs-header {
    height: 70px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 2;
}

.acs-drag-indicator {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.acs-title {
    font-size: 18px;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.acs-count {
    font-size: 13px;
    color: var(--acs-text-dim);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.acs-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.acs-close-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.1);
}

/* --- BODY (SCROLL LIST) --- */
.acs-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0 120px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.acs-body::-webkit-scrollbar {
    display: none;
}

.acs-loading {
    padding: 60px 40px;
    text-align: center;
    color: var(--acs-text-dim);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.acs-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--acs-primary);
    border-radius: 50%;
    animation: acs-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* --- COMMENT ITEM --- */
.acs-comment {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    animation: acs-fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

.acs-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #222;
    flex-shrink: 0;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.acs-avatar-small {
    width: 32px;
    height: 32px;
}

.acs-comment-reply {
    padding-left: 65px; /* TikTok Style Indentation */
    padding-top: 5px;
    padding-bottom: 15px;
    background: rgba(255, 255, 255, 0.01);
}

.acs-comment-main {
    flex: 1;
    min-width: 0;
}

.acs-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.acs-username {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    opacity: 0.95;
}

.acs-badge {
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.acs-badge-admin {
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    color: white;
}

.acs-time {
    font-size: 11px;
    color: var(--acs-text-dim);
    font-weight: 500;
}

.acs-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    word-break: break-word;
}

.acs-image-attachment {
    margin-top: 12px;
    border-radius: 20px;
    overflow: hidden;
    max-width: 240px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.acs-actions {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    align-items: center;
}

.acs-action-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--acs-text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0;
    font-weight: 700;
    transition: all 0.2s;
}

.acs-action-btn i {
    font-size: 16px;
}

.acs-action-btn.active {
    color: var(--acs-primary);
}

.acs-action-btn:active {
    transform: scale(0.9);
}

/* --- INPUT AREA --- */
.acs-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px;
    background: rgba(18, 18, 22, 0.95);
    backdrop-filter: blur(25px);
    border-top: 1px solid var(--acs-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: max(15px, env(safe-area-inset-bottom, 25px));
    z-index: 10;
}

.acs-preview-area {
    display: none;
    padding: 5px 0;
}

.acs-preview-container {
    position: relative;
    display: inline-block;
}

.acs-preview-img {
    height: 70px;
    width: auto;
    border-radius: 12px;
    border: 2px solid var(--acs-primary);
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.3);
}

.acs-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.acs-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.acs-input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    /* Textarea uzadıkça butonların aşağıda kalmaması için */
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.acs-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    max-height: 100px;
    overflow-y: auto;
    padding: 8px 0;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    font-weight: 500;
}

.acs-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.acs-input:focus {
    outline: none;
}

.acs-util-btn {
    width: 32px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    flex-shrink: 0;
}

.acs-util-btn:active {
    transform: scale(0.85);
    color: var(--acs-primary);
}

.acs-send-btn {
    height: 40px;
    width: 85px;
    /* Sabit genişlik taşmayı önler */
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    color: white;
    border-radius: 20px;
    border: none;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 15px rgba(236, 72, 153, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
}

.acs-char-count {
    font-size: 9px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.15);
    margin-right: 5px;
    margin-bottom: 12px;
}

.acs-reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 5px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.acs-reply-preview span {
    font-size: 11px;
    font-weight: 600;
    color: var(--acs-primary);
}

.acs-send-btn i {
    font-size: 12px;
}

.acs-send-btn:active {
    transform: scale(0.9);
}

.acs-send-btn:disabled {
    background: #25252b;
    color: #555;
    box-shadow: none;
    opacity: 0.8;
}

/* --- EMOJI PICKER --- */
.acs-emoji-picker {
    display: none;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    margin-bottom: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.acs-emoji-picker.active {
    display: grid;
}

.acs-emoji-item {
    font-size: 24px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.acs-emoji-item:active {
    transform: scale(1.4);
}

/* --- ANIMATIONS --- */
@keyframes acs-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes acs-fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

@keyframes acs-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

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

.acs-liked i {
    animation: acs-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--acs-primary) !important;
}@keyframes acs-highlight-glow { from { box-shadow: 0 0 0px transparent; } to { box-shadow: 0 0 20px rgba(236, 72, 153, 0.2); } } .acs-highlight-shake { animation: acs-highlight-glow 2s ease-in-out infinite alternate !important; border-left: 4px solid var(--acs-primary) !important; background: rgba(236, 72, 153, 0.05) !important; border-radius: 12px; }
