/**
 * Cimahi Timeline CSS
 * 
 * Styles for timeline component
 */

/* Timeline Container */
.cm-timeline-container {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    background-color: #1E1E2E;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Timeline Filters */
.cm-timeline-filters {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #1E1E2E;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cm-timeline-filter {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    color: #aaa;
    font-weight: 500;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.cm-timeline-filter:hover {
    color: #00FFAA;
    background-color: rgba(0, 255, 170, 0.1);
}

.cm-timeline-filter.active {
    color: #00FFAA;
    border-bottom: 2px solid #00FFAA;
}

/* Timeline Content */
.cm-timeline-content {
    padding: 10px 0;
}

/* Timeline Item */
.cm-timeline-item {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.cm-timeline-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.cm-timeline-item:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.cm-timeline-item:last-child {
    border-bottom: none;
}

/* Item Header */
.cm-timeline-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.cm-timeline-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #008770;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.cm-timeline-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.cm-timeline-user {
    font-weight: bold;
    color: #ffffff;
    margin-right: 5px;
}

/* Item Content */
.cm-timeline-content-text {
    margin-left: 50px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
}

.cm-timeline-amount {
    font-weight: bold;
    color: #00FFAA;
}

.cm-timeline-category {
    color: #00AAFF;
}

.cm-timeline-mitra {
    color: #FFD700;
}

/* Item Footer */
.cm-timeline-footer {
    margin-top: 8px;
    margin-left: 50px;
    color: #777;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.cm-timeline-time {
    display: flex;
    align-items: center;
}

.cm-timeline-time svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.cm-timeline-type {
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.1);
}

.cm-timeline-type.donation {
    background-color: rgba(0, 255, 170, 0.15);
    color: #00FFAA;
}

.cm-timeline-type.quest {
    background-color: rgba(0, 170, 255, 0.15);
    color: #00AAFF;
}

.cm-timeline-type.transaction {
    background-color: rgba(255, 215, 0, 0.15);
    color: #FFD700;
}

/* Empty State */
.cm-timeline-empty {
    padding: 30px;
    text-align: center;
    color: #777;
    font-style: italic;
}

/* Load More Button */
.cm-timeline-load-more {
    padding: 15px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cm-load-more-btn {
    background-color: #008770;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cm-load-more-btn:hover {
    background-color: #00FFAA;
    color: #1E1E2E;
}

/* Instagram-style Like and Comment functionality */
.cm-timeline-interactions {
    margin-top: -10px;
    
    margin-left: 50px;
    display: flex;
    flex-direction: column;
}

/* Interaction Buttons - Updated Uniform Style */
.cm-interaction-buttons {
    display: flex;
    gap: 12px;
    margin-top:12px;
    margin-bottom:8px;
}

.cm-like-button,
.cm-view-button,
.cm-comment-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

/* Hover state */
.cm-like-button:hover,
.cm-view-button:hover,
.cm-comment-button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: none !important;
}

/* Active state */
.cm-like-button:active,
.cm-view-button:active,
.cm-comment-button:active {
    transform: scale(0.95);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Focus state - for accessibility */
.cm-like-button:focus,
.cm-view-button:focus,
.cm-comment-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 255, 170, 0.3);
    border-radius: 50%;
}

.cm-like-button svg,
.cm-view-button svg,
.cm-comment-button svg {
    width: 18px;
    height: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cm-like-count,
.cm-view-count,
.cm-comment-count {
    position: absolute;
    right: -4px;
    bottom: -4px;
    font-size: 10px;
    color: #FFD700;
    background: rgba(0,0,0,0.7);
    border-radius: 8px;
    padding: 0 4px;
    min-width: 16px;
    text-align: center;
}

.cm-like-button.liked svg {
    fill: #FF3040;
    stroke: #FF3040;
}

.cm-like-button svg {
    fill: none;
    stroke: #FF3040;
    stroke-width: 2;
    transition: all 0.2s ease;
}

.cm-like-button.liked svg {
    fill: #FF3040;
    stroke: #FF3040;
}

.cm-comment-button svg {
    fill: none;
    stroke: #00FFAA;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.cm-comment-button:hover svg {
    transform: scale(0.9);
}

.cm-comment-count {
    color: #00FFAA;
}

/* Comment Modal */
.cm-comment-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: #1E1E2E;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 9999;
    display: none;
    overflow: hidden;
}

.cm-comment-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cm-comment-modal-header {
    padding: 15px;
    background: #2A2A3A;
    border-bottom: 1px solid #3A3A4A;
    color: #FFFFFF;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cm-comment-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    color: #E0E0E0;
    background: #1E1E2E;
}

.cm-comment-modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: #AAAAAA;
}

.cm-comment-modal-close:hover {
    color: #FFFFFF;
}

.cm-comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.cm-comment-form-container {
    padding: 15px;
    background-color: #1E1E2E;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cm-comment-form {
    display: flex;
    align-items: center;
}

.cm-comment-input-wrapper {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0 15px;
    flex: 1;
}

#comment-text {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 14px;
    color: white;
    outline: none;
}

#comment-text::placeholder {
    color: #aaa;
}

.cm-comment-submit {
    background: transparent;
    border: none;
    color: #00FFAA;
    font-weight: bold;
    padding: 0 0 0 10px;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s ease;
}

.cm-comment-submit:hover {
    color: white;
}

.cm-comment-submit:disabled {
    color: #555;
    cursor: not-allowed;
}

/* Comment styles */
.cm-comment-item {
    display: flex;
    margin-bottom: 15px;
}

.cm-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    background-color: #008770;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    font-size: 12px;
}

.cm-comment-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.cm-comment-content {
    flex: 1;
}

.cm-comment-username {
    font-weight: bold;
    color: white;
    margin-right: 8px;
    font-size: 13px;
}

.cm-comment-text {
    color: #ddd;
    font-size: 13px;
    margin-bottom: 4px;
    word-break: break-word;
}

.cm-comment-actions {
    display: flex;
    font-size: 12px;
    color: #777;
    margin-top: 4px;
}

.cm-comment-time {
    margin-right: 15px;
}

.cm-comment-like,
.cm-comment-reply {
    cursor: pointer;
    margin-right: 15px;
    background: transparent;
}

.cm-comment-like:hover,
.cm-comment-reply:hover {
    color: white;
}

.cm-comment-like.liked {
    color: #FF3040;
}

.cm-comment-replies {
    margin-top: 8px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.cm-reply-form {
    margin-top: 12px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.cm-replying-to {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}

.cm-cancel-reply {
    cursor: pointer;
    color: #00FFAA;
    margin-left: 5px;
}

.cm-cancel-reply:hover {
    text-decoration: underline;
}

/* Comment loading */
.cm-comment-loading {
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-style: italic;
}

/* Like users popup */
.cm-likes-popup {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.cm-likes-popup-content {
    background-color: #1E1E2E;
    margin: 15vh auto;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s;
}

.cm-likes-popup-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: white;
}

.cm-likes-popup-close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.cm-likes-popup-close:hover {
    color: white;
}

.cm-likes-popup-body {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
    background-color: #1E1E2E;
}

.cm-like-user-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cm-like-user-item:last-child {
    border-bottom: none;
}

.cm-like-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    background-color: #008770;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.cm-like-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.cm-like-user-name {
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Comment Preview Styles */
.cm-comment-preview-username,
.cm-comment-preview-text {
    color: #808080;
    font-size : 14px !important;
}

.cm-comment-preview-more {
    color: #808080;
    font-size : 14px !important;
}

/* Animations */
@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(20px);}
    to {opacity: 1; transform: translateY(0);}
}

/* Heart animation */
.cm-heart-animation {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 10;
    opacity: 0.8;
    transform: scale(0) translate(-50%, -50%);
    animation: heart-beat 0.8s forwards;
}

@keyframes heart-beat {
    0% { transform: scale(0) translate(-50%, -50%); opacity: 0.8; }
    15% { transform: scale(1.2) translate(-50%, -50%); opacity: 0.9; }
    30% { transform: scale(1) translate(-50%, -50%); opacity: 1; }
    45% { transform: scale(1.3) translate(-50%, -50%); opacity: 0.9; }
    60% { transform: scale(1) translate(-50%, -50%); opacity: 0.8; }
    100% { transform: scale(2) translate(-50%, -50%); opacity: 0; }
}

/* Tooltips */
.cm-like-tooltip,
.cm-tap-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cm-tap-tooltip {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Notification */
.cm-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #008770;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cm-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.cm-notification-success {
    background-color: #008770;
}

.cm-notification-error {
    background-color: #FF3040;
}

.cm-notification-warning {
    background-color: #FFB700;
    color: #1E1E2E;
}

/* Double tap area */
.cm-double-tap-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Like Button Loading State */
.cm-like-button.loading {
    opacity: 0.7;
    pointer-events: none;
}
.cm-like-button.loading svg {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .cm-timeline-filter {
        padding: 10px 5px;
        font-size: 12px;
    }
    
    .cm-timeline-item {
        padding: 12px;
    }
    
    .cm-timeline-avatar {
        width: 35px;
        height: 35px;
    }
    
    .cm-timeline-content-text {
        margin-left: 45px;
        font-size: 13px;
    }
    
    .cm-timeline-footer,
    .cm-timeline-interactions {
        margin-left: 45px;
    }
    
    .cm-comment-modal-content,
    .cm-likes-popup-content {
        width: 95%;
        margin: 10vh auto;
    }
}

/* Loading state */
.cm-timeline-loading {
    text-align: center;
    padding: 20px;
    color: #aaa;
}

.cm-timeline-loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #00FFAA;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty States */
.cm-empty {
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-style: italic;
}

/* More Likes Section */
.cm-more-likes {
    text-align: center;
    padding: 10px;
    color: #aaa;
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 10px;
}

/* Shimmer Loading Effect */
.cm-shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.cm-shimmer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.cm-shimmer-line {
    height: 12px;
    margin: 5px 0;
    border-radius: 4px;
}

.cm-shimmer-text {
    width: 80%;
}

.cm-shimmer-text-short {
    width: 40%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
