/* BuddyBoss Stories CSS - Created by Taylor Gerard */

/* Navigation Menu Styles */
.menu-item-stories a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.menu-item-stories .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Body lock when modal is open */
body.bbstory-modal-open {
    overflow: hidden !important;
}

/* Stories Grid Container */
.bbstories-container {
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.bbstories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Individual story view */
.bbstories-individual-view .bbstories-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.bbstory-individual .bbstory-timestamp {
    font-size: 11px;
    color: #8e8e8e;
    margin-top: 4px;
}

/* Individual Story Item */
.bbstory-item {
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease;
}

.bbstory-item:hover {
    transform: scale(1.05);
}

.bbstory-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 8px;
}

.bbstory-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid #e1306c;
    padding: 3px;
    box-sizing: border-box;
    position: relative;
    background-clip: content-box;
    transition: border-color 0.3s ease;
}

.bbstory-item:hover .bbstory-avatar {
    border-color: #fd5949;
}

.bbstory-user-avatar {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.bbstory-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e1306c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

.bbstory-author-name {
    font-size: 12px;
    color: #262626;
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bbstory-author-link {
    text-decoration: none;
    color: #262626;
    display: block;
    transition: color 0.2s ease;
}

.bbstory-author-link:hover {
    color: #0095f6;
    text-decoration: none;
}

.bbstory-author-link:visited {
    color: #262626;
}

.bbstories-empty {
    text-align: center;
    color: #8e8e8e;
    padding: 40px;
    font-size: 16px;
}

/* Story Modal - Mobile Optimized */
.bbstory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    pointer-events: none;
}

.bbstory-modal.active {
    display: block;
    pointer-events: auto;
}

.bbstory-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
    pointer-events: auto;
}

.bbstory-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    z-index: 2;
    pointer-events: auto;
}

.bbstory-display {
    position: relative;
    background: #000;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

/* Modal Header */
.bbstory-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    gap: 12px;
}

.bbstory-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #fff;
    flex-shrink: 0;
}

.bbstory-modal-info {
    flex: 1;
    min-width: 0;
}

.bbstory-modal-author {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bbstory-modal-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.bbstory-views {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    margin-left: auto;
    margin-right: 10px;
}

.bbstory-views .dashicons {
    color: #fff;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.bbstory-view-count {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* Close Button */
.bbstory-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.bbstory-close:hover,
.bbstory-close:active {
    background: rgba(0, 0, 0, 0.9);
}

/* Navigation Buttons */
.bbstory-prev,
.bbstory-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 3;
    transition: background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.bbstory-prev:hover,
.bbstory-prev:active,
.bbstory-next:hover,
.bbstory-next:active {
    background: rgba(0, 0, 0, 0.8);
}

.bbstory-prev.hidden,
.bbstory-next.hidden {
    display: none !important;
}

.bbstory-prev {
    left: 15px;
}

.bbstory-next {
    right: 15px;
}

.bbstory-prev:hover,
.bbstory-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.bbstory-prev:disabled,
.bbstory-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Delete Button */
.bbstory-delete {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.bbstory-delete:hover {
    background: rgba(220, 53, 69, 1);
}

/* Story Image */
.bbstory-image-wrapper {
    width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.bbstory-modal-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
}

/* Story Footer */
.bbstory-footer {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.bbstory-modal-description {
    color: #fff;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

/* Progress Bar */
.bbstory-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 4;
}

.bbstory-progress-bar {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
}

/* Upload Form */
.bbstories-upload-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bbstories-upload-form h3 {
    margin-top: 0;
    color: #262626;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #262626;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #dbdbdb;
    border-radius: 4px;
    cursor: pointer;
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.story-privacy-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

.bbstories-privacy-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.bbstories-privacy-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.bbstories-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #262626;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.bbstories-checkbox-label:hover {
    background: #e8f4ff;
    border-color: #2196f3;
}

.bbstories-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.bbstories-checkbox-label span {
    font-weight: 500;
}

.image-preview {
    margin-top: 15px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bbstories-submit-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease;
}

.bbstories-submit-btn:hover {
    transform: translateY(-2px);
}

.bbstories-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bbstories-message {
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
    text-align: center;
}

.bbstories-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bbstories-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bbstories-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .bbstory-avatar-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .bbstory-avatar {
        width: 80px;
        height: 80px;
    }
    
    .bbstory-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .bbstory-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 30px;
    }
    
    .bbstory-header {
        padding: 12px;
        flex-wrap: nowrap;
    }
    
    .bbstory-modal-avatar {
        width: 36px;
        height: 36px;
        margin-right: 10px;
    }
    
    .bbstory-modal-author {
        font-size: 13px;
    }
    
    .bbstory-modal-time {
        font-size: 11px;
    }
    
    .bbstory-delete {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .bbstory-prev,
    .bbstory-next {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .bbstory-prev {
        left: 10px;
    }
    
    .bbstory-next {
        right: 10px;
    }
    
    .bbstory-image-wrapper {
        max-height: 100vh;
    }
    
    .bbstory-modal-image {
        max-height: 100vh;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .bbstory-close {
        width: 40px;
        height: 40px;
        font-size: 26px;
    }
    
    .bbstory-header {
        padding: 10px;
        gap: 8px;
    }
    
    .bbstory-modal-avatar {
        width: 32px;
        height: 32px;
    }
    
    .bbstory-delete {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Loading State */
.bbstories-loading {
    text-align: center;
    padding: 40px;
    color: #8e8e8e;
}

.bbstories-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Story Data (Hidden) */
.bbstory-data {
    display: none !important;
}
