/* Modern Story Cards CSS */

/* Wide Layout Overrides */
.container-fluid {
    max-width: 98% !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

@media (min-width: 1400px) {
    .container-fluid {
        max-width: 95% !important;
    }
}

/* Reduce grid gaps */
.row {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

/* Modern Story Card Container */
.modern-story-card {
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(75, 85, 99, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
}

.card-body {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Enhanced Animated Hover Effects */
.modern-story-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(59, 130, 246, 0.3),
        0 0 80px rgba(147, 51, 234, 0.1);
    border-color: rgba(59, 130, 246, 0.7);
    z-index: 10;
}

.modern-story-card:hover .story-media-content {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1);
}

.modern-story-card:hover .story-title {
    color: rgba(147, 197, 253, 1);
    text-shadow: 0 0 10px rgba(147, 197, 253, 0.5);
}

.modern-story-card:hover .gradient-background {
    animation: gradientShift 2s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(15deg) brightness(1.2); }
    100% { filter: hue-rotate(0deg) brightness(1); }
}

/* Share Button Styling */
.share-story-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(147, 51, 234, 0.8)) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    transition: all 0.3s ease;
}

.share-story-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 1), rgba(147, 51, 234, 1)) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.share-story-btn .reaction-emoji i {
    font-size: 1rem;
    color: white;
}

.share-story-btn .reaction-count {
    color: white;
    font-weight: 500;
}

/* Story Link */
.story-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Story Excerpt Section */
.story-excerpt {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.4), rgba(17, 24, 39, 0.4));
}

.story-excerpt .story-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: rgb(243, 244, 246);
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-metadata-top {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    color: rgb(147, 197, 253);
    padding: 0.4rem 0.8rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(5px);
}

.category-badge i {
    font-size: 0.9rem;
}

.mood-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(75, 85, 99, 0.4);
    border: 2px solid rgba(156, 163, 175, 0.3);
    margin-left: auto;
}

.mood-emoji {
    font-size: 1.2rem;
}

/* Remove old story title styles - now handled in .story-excerpt .story-title */

/* Modern Media Wrapper */
.media-wrapper {
    position: relative;
    width: 100%;
}

.story-media {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-media-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Content Warning Styles */
.content-warning-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 20;
}

.warning-badge {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(185, 28, 28, 0.9));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    backdrop-filter: blur(5px);
    cursor: help;
    transition: all 0.3s ease;
}

.warning-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.warning-badge.warning-low {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
    border-color: rgba(245, 158, 11, 0.3);
}

.warning-badge.warning-medium {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.9), rgba(234, 88, 12, 0.9));
    border-color: rgba(249, 115, 22, 0.3);
}

.warning-badge.warning-high {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(185, 28, 28, 0.9));
    border-color: rgba(239, 68, 68, 0.3);
}

.warning-badge.warning-critical {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.95), rgba(127, 29, 29, 0.95));
    border-color: rgba(185, 28, 28, 0.5);
    animation: warningPulse 2s ease-in-out infinite;
}

@keyframes warningPulse {
    0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.7); }
    70% { box-shadow: 0 0 0 5px rgba(185, 28, 28, 0); }
    100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}

/* Blur effect for sensitive content */
.content-blur {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

.modern-story-card:hover .content-blur {
    filter: blur(0px);
}

.story-media {
    position: relative;
    width: 100%;
    height: 100%;
}

.story-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.story-media:hover .story-media-img {
    transform: scale(1.1);
}

.story-media-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-icon {
    font-size: 2rem;
    color: white;
}

/* Media Placeholder */
.story-media-placeholder {
    width: 100%;
    height: 100%;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gradient-background {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.4), 
        rgba(147, 51, 234, 0.4),
        rgba(236, 72, 153, 0.4),
        rgba(245, 158, 11, 0.4)
    );
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

.gradient-background[data-category="achievement"] {
    background: linear-gradient(135deg, 
        rgba(34, 197, 94, 0.4), 
        rgba(59, 130, 246, 0.4)
    );
}

.gradient-background[data-category="challenge"] {
    background: linear-gradient(135deg, 
        rgba(239, 68, 68, 0.4), 
        rgba(245, 158, 11, 0.4)
    );
}

.gradient-background[data-category="reflection"] {
    background: linear-gradient(135deg, 
        rgba(147, 51, 234, 0.4), 
        rgba(168, 85, 247, 0.4)
    );
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.placeholder-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.8;
}

/* Auto-Generated Image Styles */
.auto-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.generating-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    animation: pulse 2s infinite;
}

.generating-text {
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.generated-story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Auto-Generated Visual Styles */
.auto-generated-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 140px;
    width: 100%;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.content-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.content-theme {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    opacity: 0.9;
}

/* Story Media Placeholder */
.story-media-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generated-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Story Reactions */
.story-reactions {
    padding: 0.5rem 1rem 0.75rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.6), rgba(31, 41, 55, 0.6));
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.reaction-btn {
    background: rgba(75, 85, 99, 0.4);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 20px;
    padding: 0.3rem 0.6rem;
    color: rgb(209, 213, 219);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.reaction-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.reaction-emoji {
    font-size: 0.9rem;
}

.reaction-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(156, 163, 175);
}

.story-summary {
    color: rgb(209, 213, 219);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    text-align: left;
}

/* Story Stats */
.story-stats {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgb(156, 163, 175);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-item i {
    font-size: 1rem;
    color: rgb(59, 130, 246);
}

/* Interactive Footer */
.story-card-footer {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.6), rgba(31, 41, 55, 0.6));
    border-top: 1px solid rgba(75, 85, 99, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reaction-bar {
    display: flex;
    gap: 0.5rem;
}

.modern-reaction-btn {
    background: rgba(75, 85, 99, 0.4);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    color: rgb(209, 213, 219);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modern-reaction-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.reaction-emoji {
    font-size: 1rem;
}

.reaction-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(156, 163, 175);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: rgba(75, 85, 99, 0.4);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(156, 163, 175);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    color: rgb(147, 197, 253);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-story-card {
        border-radius: 16px;
    }
    
    .story-card-header {
        padding: 1.2rem 1.2rem 0.8rem;
    }
    
    .story-title {
        font-size: 1.2rem;
    }
    
    .story-content-preview {
        padding: 1.2rem;
    }
    
    .story-media-container {
        min-height: 180px;
    }
    
    .story-stats {
        gap: 1rem;
    }
    
    .reaction-bar {
        gap: 0.3rem;
    }
    
    .modern-reaction-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* Loading Animation */
.modern-story-card.loading {
    animation: cardPulse 1.5s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Card Entry Animation */
.modern-story-card {
    animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.modern-story-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

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

/* Share Modal Styles */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.share-modal {
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(75, 85, 99, 0.3);
    backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.share-modal-header h4 {
    color: rgb(243, 244, 246);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: rgb(156, 163, 175);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(75, 85, 99, 0.4);
    color: white;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(75, 85, 99, 0.4);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 15px;
    padding: 1.5rem 1rem;
    color: rgb(209, 213, 219);
    transition: all 0.3s ease;
    cursor: pointer;
}

.share-option:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.share-option i {
    font-size: 1.5rem;
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 10001;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast-message.show {
    transform: translateX(0);
}

/* Bookmarked State */
.action-btn.bookmarked {
    background: rgba(245, 158, 11, 0.3) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: rgb(251, 191, 36) !important;
}

/* Active/Reacted State - for one reaction per story */
.reaction-btn.active,
.reaction-btn.reacted,
.modern-reaction-btn.active,
.modern-reaction-btn.reacted {
    background: rgba(59, 130, 246, 0.5) !important;
    border-color: rgba(59, 130, 246, 0.8) !important;
    color: rgb(147, 197, 253) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.reaction-btn.active .reaction-count,
.reaction-btn.reacted .reaction-count,
.modern-reaction-btn.active .reaction-count,
.modern-reaction-btn.reacted .reaction-count {
    color: rgb(147, 197, 253) !important;
    font-weight: 700;
}

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

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

/* Light Theme Overrides */
[data-bs-theme="light"] .modern-story-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border-color: rgba(203, 213, 225, 0.4);
}

[data-bs-theme="light"] .story-card-header {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.6), rgba(241, 245, 249, 0.6));
}

[data-bs-theme="light"] .story-title {
    color: rgb(31, 41, 55);
}

[data-bs-theme="light"] .story-excerpt {
    color: rgb(75, 85, 99);
}

[data-bs-theme="light"] .story-content-preview {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.6), rgba(255, 255, 255, 0.6));
}

[data-bs-theme="light"] .story-card-footer {
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.8), rgba(248, 250, 252, 0.8));
}

[data-bs-theme="light"] .modern-reaction-btn,
[data-bs-theme="light"] .action-btn {
    background: rgba(241, 245, 249, 0.6);
    border-color: rgba(203, 213, 225, 0.4);
    color: rgb(75, 85, 99);
}

[data-bs-theme="light"] .share-modal {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border-color: rgba(203, 213, 225, 0.4);
}

[data-bs-theme="light"] .share-modal-header h4 {
    color: rgb(31, 41, 55);
}

[data-bs-theme="light"] .share-option {
    background: rgba(241, 245, 249, 0.6);
    border-color: rgba(203, 213, 225, 0.4);
    color: rgb(75, 85, 99);
}

/* Enhanced Pagination Styles */
.pagination-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pagination-info p {
    margin: 0;
    font-size: 1.1rem;
    color: #e0e0e0;
}

.pagination-lg .page-link {
    padding: 12px 18px;
    font-size: 1.1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    margin: 0 2px;
    border-radius: 8px;
}

.pagination-lg .page-link:hover {
    background-color: rgba(108, 117, 125, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pagination-lg .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: scale(1.05);
}

.pagination-lg .page-item.disabled .page-link {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-lg {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-lg .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        margin: 1px;
    }
    
    .pagination-info {
        padding: 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .pagination-lg .page-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .pagination-info p {
        font-size: 0.9rem;
    }
}