/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables for Light/Dark Themes */
:root {
    /* Light theme colors */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-color: #333;
    --header-bg: rgba(255, 255, 255, 0.95);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-text: #555;
    --footer-bg: rgba(0, 0, 0, 0.8);
    --footer-text: #ccc;
    --primary-color: #667eea;
    --primary-hover: #5a6fd8;
    --accent-color: #64b5f6;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --dropdown-bg: white;
    --dropdown-text: #333;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --warning-color: #ffc107;
    --content-bg: #f8f9fa;
    --content-border: #e9ecef;
}

.dark-mode {
    /* Dark theme colors */
    --bg-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --text-color: #e0e0e0;
    --header-bg: rgba(30, 30, 30, 0.95);
    --card-bg: rgba(40, 40, 40, 0.95);
    --card-text: #b0b0b0;
    --footer-bg: rgba(0, 0, 0, 0.9);
    --footer-text: #a0a0a0;
    --primary-color: #5a7fd8;
    --primary-hover: #4a6fc6;
    --accent-color: #42a5f5;
    --border-color: #444;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --dropdown-bg: #333;
    --dropdown-text: #e0e0e0;
    --secondary-color: #555;
    --secondary-hover: #666;
    --warning-color: #ffb347;
    --content-bg: #2a2a2a;
    --content-border: #555;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-gradient);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.logo a:hover {
    color: var(--accent-color);
}

.logo i {
    font-size: 2rem;
}

/* Dark Mode Toggle */
.toggle-btn {
    background: var(--primary-color);
    color: white;
    padding: 10px 16px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.toggle-text {
    font-size: 13px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .toggle-text {
        display: none;
    }
    
    .header-controls {
        gap: 0.5rem;
    }
    
    .toggle-btn {
        padding: 10px 12px;
    }
}

/* Language Selector */
.language-selector .dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.dropbtn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--dropdown-bg);
    min-width: 180px;
    box-shadow: 0 8px 16px var(--shadow-color);
    border-radius: 8px;
    z-index: 1;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--dropdown-text);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.dropdown-content a:hover {
    background-color: var(--border-color);
}

.dropdown-content a.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.flag {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Sorting Controls */
.sorting-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.sort-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.sort-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.sort-btn i {
    font-size: 0.9rem;
}

/* Stories Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.story-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s ease;
    transform: translateY(0);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.story-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.story-card-header i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.story-card-header h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    font-weight: 600;
}

.story-info {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--card-text);
}

.info-item i {
    color: var(--primary-color);
    width: 16px;
}

.available-languages small {
    color: var(--card-text);
    font-weight: 500;
}

.language-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.language-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.story-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.story-summary-preview {
    margin: 1rem 0;
    min-height: 60px;
    flex-grow: 1;
}

.story-summary-preview p {
    color: var(--card-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    text-align: justify;
}

.story-card-footer {
    margin-top: 1.5rem;
    text-align: center;
}

/* Story Statistics */
.story-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 60px;
    min-height: 60px; /* Ensure consistent height for alignment */
}

.stat-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.stat-item span {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.stat-item small {
    color: var(--card-text);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Story Header Statistics (larger version for story detail page) */
.story-header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--content-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-item-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
}

.stat-item-large i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.stat-number {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.4rem;
}

.stat-label {
    color: var(--card-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
}

/* Story Detail Page */
.story-header {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px var(--shadow-color);
}

.breadcrumb {
    margin-bottom: 1rem;
}

.story-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Story title section with inline stats */
.story-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Creator and date information - inline version */
.story-meta-inline {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-left: auto;
    padding-left: 1rem;
}

.story-creator-inline,
.story-date-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--card-text);
    font-size: 0.8rem;
}

.story-creator-inline i,
.story-date-inline i {
    color: var(--primary-color);
    font-size: 0.7rem;
    width: 10px;
    text-align: center;
}

/* Inline stats next to title */
.story-stats-inline {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.stat-item-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--content-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    min-width: auto;
}

.stat-item-inline i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.stat-number-inline {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
}

.stat-label-inline {
    color: var(--card-text);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Voting Button Styles */
.voting-button {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.voting-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow-color);
    background: var(--primary-color);
}

.voting-button:hover i {
    color: white;
}

.voting-button:hover .stat-number-inline,
.voting-button:hover .stat-label-inline {
    color: white;
}

.voting-button:active {
    transform: translateY(0);
}

/* Voted state - red color for user's votes */
.voting-button i.voted {
    color: #dc3545 !important;
}

.voting-button:hover i.voted {
    color: #fff !important;
}

/* Display-only voting styles for main page */
.voting-display {
    cursor: default !important;
    opacity: 0.8;
    transition: none !important;
}

.voting-display:hover {
    background: none !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.voting-display:hover i,
.voting-display:hover span {
    color: inherit !important;
}

.voting-display i.voted {
    color: #dc3545 !important;
}

.voting-display:hover i.voted {
    color: #dc3545 !important;
}

/* Stat item voting styles for index page */
.stat-item.voting-button {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.stat-item.voting-button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow-color);
}

.stat-item.voting-button:hover i,
.stat-item.voting-button:hover span {
    color: white !important;
}

.stat-item.voting-button i.voted {
    color: #dc3545 !important;
}

/* Display-only stat items for main page */
.stat-item.voting-display {
    cursor: default !important;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid transparent;
    opacity: 0.9;
    transition: none !important;
    position: relative;
    pointer-events: none; /* Completely disable any mouse interactions */
}

.stat-item.voting-display:hover {
    background: none !important;
    border-color: transparent !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.9 !important; /* Maintain same opacity on hover */
}

.stat-item.voting-display:hover i,
.stat-item.voting-display:hover span {
    color: inherit !important;
}

.stat-item.voting-display i.voted {
    color: #dc3545 !important;
}

.stat-item.voting-display:hover i.voted {
    color: #dc3545 !important; /* Keep the red color even on hover */
}

/* Ensure no highlighting effects whatsoever */
.stat-item.voting-display * {
    pointer-events: none !important;
}

/* Favorite Button Styles */
.favorite-button {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.favorite-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow-color);
    background: #ffd700;
}

.favorite-button:hover i {
    color: white;
}

.favorite-button:hover .stat-label-inline {
    color: white;
}

.favorite-button:active {
    transform: translateY(0);
}

/* Favorited state - golden color for user's favorites */
.favorite-button i.favorited {
    color: #ffd700 !important;
}

.favorite-button:hover i.favorited {
    color: #fff !important;
}

/* Display-only favorite styles for main page */
.favorite-display {
    cursor: default;
    pointer-events: none;
}

.favorite-display i.favorited {
    color: #ffd700 !important;
}

/* Delete Button Styles */
.delete-button {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background: var(--content-bg) !important;
    border: 1px solid #dc3545 !important;
}

.delete-button i {
    color: #dc3545;
}

.delete-button .stat-label-inline {
    color: #dc3545;
    font-weight: 600;
}

.delete-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

.delete-button:hover i {
    color: white !important;
}

.delete-button:hover .stat-label-inline {
    color: white !important;
}

.delete-button:active {
    transform: translateY(0);
}

/* Stat item favorite styles */
.stat-item.favorite-display {
    cursor: default;
    transition: none;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.stat-item.favorite-display i.favorited {
    color: #ffd700 !important;
}

.stat-item.favorite-display i:not(.favorited) {
    color: #ccc;
}

/* Content Warning Styles */
.content-warnings {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.warning-message {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    color: var(--warning-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-message i {
    color: var(--warning-color);
    font-size: 1rem;
}

.story-language-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.language-select {
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
}

.story-content {
    display: grid;
    gap: 2rem;
}

.story-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
}

.story-section h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-content {
    background: var(--content-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.summary-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--card-text);
}

/* Audio Player Styles */
.audio-player-container {
    background: var(--content-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--content-border);
}

.custom-audio-player {
    width: 100%;
    position: relative;
    z-index: 1;
}

.audio-player {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    outline: none;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    background: var(--content-bg);
}

/* Audio player dark mode support */
.dark-mode .audio-player {
    background: var(--content-bg);
    border: 1px solid var(--border-color);
}

/* Webkit audio controls styling for dark mode */
.dark-mode .audio-player::-webkit-media-controls-enclosure {
    background-color: var(--content-bg);
    border-radius: 8px;
}

.dark-mode .audio-player::-webkit-media-controls-panel {
    background-color: var(--content-bg);
}

.dark-mode .audio-player::-webkit-media-controls-current-time-display,
.dark-mode .audio-player::-webkit-media-controls-time-remaining-display {
    color: var(--text-color);
}

.dark-mode .audio-player::-webkit-media-controls-timeline {
    background-color: var(--content-bg);
}

.dark-mode .audio-player::-webkit-media-controls-timeline-container {
    background-color: var(--content-bg);
}

.dark-mode .audio-player::-webkit-media-controls-time-remaining-display {
    background-color: var(--content-bg);
}

.dark-mode .audio-player::-webkit-media-controls-current-time-display {
    background-color: var(--content-bg);
}

.dark-mode .audio-player::-webkit-media-controls-volume-slider {
    background-color: var(--content-bg);
}

.dark-mode .audio-player::-webkit-media-controls-seek-back-button,
.dark-mode .audio-player::-webkit-media-controls-seek-forward-button,
.dark-mode .audio-player::-webkit-media-controls-play-button,
.dark-mode .audio-player::-webkit-media-controls-fullscreen-button,
.dark-mode .audio-player::-webkit-media-controls-mute-button {
    background-color: var(--content-bg);
    color: var(--text-color);
}

.audio-parts h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.audio-part {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--content-border);
}

.part-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--content-border);
}

/* Story Text */
.story-text {
    background: var(--content-bg);
    padding: 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
    border: 1px solid var(--content-border);
}

/* No Stories Message */
.no-stories {
    text-align: center;
    padding: 4rem 2rem;
    color: white;
}

.no-stories i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-stories h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-message {
    font-size: 1.5rem;
    font-weight: 300;
    color: white;
    margin: 0;
    opacity: 0;
    animation: fadeInOut 2s ease-in-out infinite;
}

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

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
    }
    
    .story-title {
        font-size: 2rem;
    }
    
    .story-stats-inline {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: flex-start;
    }
    
    .stat-item-inline {
        padding: 0.3rem 0.6rem;
        gap: 0.3rem;
    }
    
    .stat-number-inline {
        font-size: 0.9rem;
    }
    
    .stat-label-inline {
        font-size: 0.65rem;
    }
    
    .story-language-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .part-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .story-stats {
        gap: 0.75rem;
    }
    
    .stat-item small {
        font-size: 0.7rem;
    }
    
    .story-header-stats {
        gap: 1.5rem;
        padding: 0.75rem;
    }
    
    .stat-item-large {
        min-width: 60px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .story-header,
    .story-section {
        padding: 1.5rem;
    }
    
    .page-header h2 {
        font-size: 2rem;
    }
    
    .sorting-controls {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .sort-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .story-stats {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .story-stats-inline {
        gap: 0.75rem;
        margin-top: 0.25rem;
    }
    
    .stat-item-inline {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }
    
    .stat-item-inline i {
        font-size: 0.8rem;
    }
    
    .stat-number-inline {
        font-size: 0.85rem;
    }
    
    .stat-label-inline {
        font-size: 0.6rem;
    }
    
    .stat-item {
        min-width: 50px;
    }
    
    .stat-item i {
        font-size: 1rem;
    }
    
    .stat-item span {
        font-size: 0.9rem;
    }
    
    .story-header-stats {
        gap: 1rem;
        padding: 0.5rem;
        flex-wrap: wrap;
    }
    
    .stat-item-large {
        min-width: 50px;
    }
    
    .stat-item-large i {
        font-size: 1.3rem;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

/* Security - Hide download controls and prevent downloads */
audio::-webkit-media-controls-download-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

audio::-moz-media-controls-download-button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Additional security - hide any download-related controls */
audio::-webkit-media-controls-overflow-button {
    display: none !important;
}

audio[controls]::-webkit-media-controls-enclosure {
    overflow: hidden;
}

/* Prevent selection of audio element */
audio {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* Authentication Styles */
.auth-section {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.welcome-message {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.welcome-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.welcome-content i {
    font-size: 1.2rem;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #4285f4;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.google-signin-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-name-link:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    text-decoration: none;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.submit-story-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.submit-story-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: white;
}

.profile-picture {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

/* Mobile responsiveness for auth */
@media (max-width: 768px) {
    .auth-section {
        margin-right: 0.5rem;
    }
    
    .google-signin-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .google-signin-btn span {
        display: none;
    }
    
    .submit-story-btn span {
        display: none;
    }
    
    .user-name-link span {
        display: none;
    }
}

/* Alert Styles */
.alert {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.dark-mode .alert-success {
    background-color: rgba(25, 135, 84, 0.2);
    border-color: rgba(25, 135, 84, 0.3);
    color: #75b798;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.dark-mode .alert-error {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
    color: #f8a2aa;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffda6a;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.dark-mode .alert-info {
    background-color: rgba(13, 202, 240, 0.2);
    border-color: rgba(13, 202, 240, 0.3);
    color: #6edff6;
}

/* Post submission info styles */
.post-submission-info {
    margin: 20px 0;
}

.post-submission-info .alert {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #90caf9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-mode .post-submission-info .alert {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.15) 0%, rgba(156, 39, 176, 0.15) 100%);
    border: 1px solid rgba(13, 202, 240, 0.3);
} 

/* Story Actions Section */
.story-actions {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Admin Badge */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.admin-badge i {
    font-size: 1rem;
}

/* Delete Button */
.btn-delete-story {
    padding: 0.75rem 1.5rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-delete-story:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-delete-story:active {
    transform: translateY(0);
}

.btn-delete-story:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.btn-delete-story i {
    font-size: 1rem;
}