/* ============================================
   POST INTERACTIONS - LIKES & COMMENTS
   Instagram-style Modal System - Enhanced v2.0
   ============================================ */

/* ============================================
   LIKES AND COMMENT COUNT IN FEED
   ============================================ */

.post-interactions {
    padding: 14px 18px;
    border-top: 1px solid #efefef;
}

.post-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
}

.post-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    color: #4a5568;
    position: relative;
}

.post-action-btn:hover {
    background: #f7fafc;
    transform: translateY(-2px);
}

.post-action-btn:active {
    transform: translateY(0);
}

/* Iconos más grandes y minimalistas */
.post-action-btn svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-action-btn.liked {
    color: #ff6b6b;
}

.post-action-btn.liked svg {
    fill: #ff6b6b;
    stroke: #ff6b6b;
    filter: drop-shadow(0 2px 8px rgba(255, 107, 107, 0.3));
}

.post-action-btn span {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.post-stats {
    font-size: 14px;
    color: #718096;
    margin-bottom: 10px;
    font-weight: 500;
}

.post-stats strong {
    color: #2d3748;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
}

.post-stats strong:hover {
    color: #ff6b6b;
}

.post-comment-preview {
    font-size: 14px;
    color: #718096;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.post-comment-preview:hover {
    color: #4299e1;
}

/* ============================================
   POST MODAL - INSTAGRAM STYLE ENHANCED
   ============================================ */

.post-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(8px);
}

.post-modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
    }
    to { 
        opacity: 1;
    }
}

.post-modal-container {
    display: flex;
    background: white;
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Close button */
.post-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #2d3748;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-modal-close:hover {
    background: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Image section */
.post-modal-image {
    flex: 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.post-modal-image img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

/* Comments section */
.post-modal-sidebar {
    width: 420px;
    min-width: 0; /* Allow sidebar to shrink in flex container */
    display: flex;
    flex-direction: column;
    background: white;
    min-height: 0; /* Required for nested flex overflow */
}

/* Post header in modal */
.post-modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.post-modal-header img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.post-modal-user-info {
    flex: 1;
}

.post-modal-username {
    font-weight: 700;
    font-size: 15px;
    color: #2d3748;
}

.post-modal-role {
    font-size: 13px;
    color: #718096;
    margin-top: 2px;
}

/* Comments list */
.post-modal-comments {
    flex: 1;
    min-height: 0; /* Required for flexbox overflow to work correctly */
    overflow-y: auto;
    padding: 20px;
}

.post-modal-comments::-webkit-scrollbar {
    width: 8px;
}

.post-modal-comments::-webkit-scrollbar-track {
    background: #f7fafc;
}

.post-modal-comments::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.post-modal-comments::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.post-caption {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.post-caption-user {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.post-caption-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.post-caption-content {
    flex: 1;
}

.post-caption-username {
    font-weight: 700;
    font-size: 15px;
    color: #2d3748;
    margin-bottom: 6px;
}

.post-caption-text {
    font-size: 15px;
    color: #2d3748;
    line-height: 1.6;
}

.post-caption-time {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 10px;
    font-weight: 500;
}

/* Individual comment */
.comment-item {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    position: relative;
}

.comment-item img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e2e8f0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-username {
    font-weight: 700;
    font-size: 14px;
    color: #2d3748;
}

.comment-role-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comment-text {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.6;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: 18px;
}

.comment-time {
    font-size: 12px;
    color: #a0aec0;
    font-weight: 500;
}

.comment-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #718096;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.comment-like-btn:hover {
    background: #f7fafc;
    color: #ff6b6b;
}

.comment-like-btn.liked {
    color: #ff6b6b;
}

.comment-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #f56565;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.comment-delete-btn:hover {
    background: #fff5f5;
}

.comments-loading {
    text-align: center;
    padding: 24px;
    color: #a0aec0;
    font-size: 14px;
    font-weight: 500;
}

.comments-empty {
    text-align: center;
    padding: 50px 20px;
    color: #a0aec0;
}

.comments-empty svg {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    opacity: 0.25;
    stroke: currentColor;
}

.comments-empty p {
    font-size: 15px;
    font-weight: 500;
}

/* Modal footer - Actions and input */
.post-modal-footer {
    border-top: 1px solid #e2e8f0;
}

.post-modal-actions {
    padding: 14px 20px;
    display: flex;
    gap: 16px;
}

.modal-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
}

.modal-action-btn:hover {
    background: #f7fafc;
    transform: translateY(-2px);
}

.modal-action-btn:active {
    transform: translateY(0);
}

/* Iconos del modal más grandes */
.modal-action-btn svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-action-btn.liked {
    color: #ff6b6b;
}

.modal-action-btn.liked svg {
    fill: #ff6b6b;
    stroke: #ff6b6b;
    filter: drop-shadow(0 2px 8px rgba(255, 107, 107, 0.3));
}

.post-modal-stats {
    padding: 0 20px 14px 20px;
    font-size: 15px;
    color: #2d3748;
    font-weight: 700;
}

.post-modal-input {
    padding: 18px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 14px;
    align-items: center;
    background: #f7fafc;
}

.post-modal-input textarea {
    flex: 1;
    border: 2px solid #e2e8f0;
    outline: none;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    padding: 12px 14px;
    max-height: 100px;
    border-radius: 12px;
    transition: all 0.2s;
    background: white;
}

.post-modal-input textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.post-modal-input textarea::placeholder {
    color: #a0aec0;
}

.post-modal-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.post-modal-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.post-modal-submit:active {
    transform: translateY(0);
}

.post-modal-submit:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
}

/* Load more button */
.load-more-comments {
    text-align: center;
    padding: 16px;
}

.load-more-btn {
    background: none;
    border: 2px solid #e2e8f0;
    color: #4299e1;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 14px;
}

.load-more-btn:hover {
    background: #ebf8ff;
    border-color: #4299e1;
    transform: translateY(-2px);
}

/* ============================================
   MOBILE RESPONSIVE - DRAWER STYLE
   ============================================ */

@media (max-width: 900px) {
    .post-modal-container {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .post-modal-image {
        flex: none;
        height: 50vh;
    }
    
    .post-modal-sidebar {
        width: 100%;
        flex: 1;
        border-radius: 24px 24px 0 0;
        margin-top: -24px;
        position: relative;
        z-index: 2;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
    }
    
    /* Drawer handle */
    .post-modal-sidebar::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 5px;
        background: #cbd5e0;
        border-radius: 3px;
    }
    
    .post-modal-header {
        padding-top: 28px;
    }
    
    .post-modal-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .post-modal-image {
        height: 40vh;
    }
    
    .post-modal-sidebar {
        flex: 1;
    }
    
    .post-action-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .post-action-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   LIKES MODAL
   ============================================ */

.likes-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.likes-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.likes-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    max-height: 560px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.likes-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    position: relative;
    color: #2d3748;
}

.likes-modal-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #718096;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.likes-modal-close:hover {
    background: #f7fafc;
    color: #2d3748;
    transform: translateY(-50%) rotate(90deg);
}

.likes-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.likes-modal-list::-webkit-scrollbar {
    width: 8px;
}

.likes-modal-list::-webkit-scrollbar-track {
    background: #f7fafc;
}

.likes-modal-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.likes-modal-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    transition: all 0.2s;
}

.likes-modal-item:hover {
    background: #f7fafc;
    transform: translateX(4px);
}

.likes-modal-item img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.likes-modal-item .username {
    font-weight: 700;
    font-size: 15px;
    color: #2d3748;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes heartBeat {
    0%, 100% { 
        transform: scale(1);
    }
    25% { 
        transform: scale(1.4);
    }
    50% { 
        transform: scale(1.15);
    }
}

.post-action-btn.liked svg,
.modal-action-btn.liked svg {
    animation: heartBeat 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pulse effect on hover */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.post-action-btn:hover svg,
.modal-action-btn:hover svg {
    animation: pulse 1.5s ease-in-out infinite;
}