/* ========================================
   COMPONENTS - Cards, Buttons, Forms
   ======================================== */

/* Card Styles */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: cardSlideIn 0.6s ease-out both;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px var(--shadow);
    border-color: var(--primary-light);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 8px 24px var(--shadow-light);
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Tab Styles */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface-elevated);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-btn i {
    font-size: 18px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.form-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-tertiary);
    font-style: italic;
    margin-left: auto;
}

.input-wrapper {
    position: relative;
}

.input, .textarea, .select {
    width: 100%;
    padding: 16px 20px;
    background: var(--surface-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.input:focus, .textarea:focus, .select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
}

.btn-success {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-rainbow {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    animation: rainbow 3s ease infinite;
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    background: var(--surface-elevated);
    border-color: var(--primary);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Status Message Styles */
.status {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.4s ease-out;
    backdrop-filter: blur(10px);
}

.status.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status.info {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-elevated);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
}

.step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.step.active {
    background: var(--success);
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    animation: stepPulse 2s ease-in-out infinite;
}

.step.completed {
    background: var(--primary);
    transform: scale(1.1);
}

/* Community Badges & Creator Info */
.community-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.community-badge i {
    font-size: 14px;
}

.creator-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.creator-info i {
    color: var(--primary);
}

.creator-name {
    font-weight: 600;
    color: var(--text-primary);
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.story-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.story-meta i {
    color: var(--primary);
    font-size: 12px;
}

/* Action Buttons */
.btn-edit {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    white-space: nowrap;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-print {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
}

.btn-print::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-print:hover::before {
    left: 100%;
}

.btn-print:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.btn-print:active {
    transform: translateY(0) scale(0.98);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Share Buttons */
.btn-share {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

.btn-share:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-unshare {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    white-space: nowrap;
}

.btn-unshare:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.remix-badge {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    cursor: default;
    opacity: 0.9;
}

.btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    white-space: nowrap;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-like {
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-like:hover {
    background: linear-gradient(135deg, #db2777, #be185d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.btn-like i {
    font-size: 14px;
}

.btn-unlike {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-unlike:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-unlike i {
    font-size: 14px;
}

.btn-share {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 36px;
}

.btn-share:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-share i {
    font-size: 14px;
}

.story-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.story-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: nowrap;
}

.story-actions-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    justify-content: space-between;
}

.story-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Fix form layout on mobile/tablet */
    .form-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .form-hint {
        margin-left: 0;
        display: block;
        width: 100%;
    }
    
    /* Stack inspiration button properly on mobile */
    #generate-idea-btn {
        width: auto;
        min-width: 200px;
        margin: 8px 0 0 0 !important;
    }
    
    /* Fix button layout on mobile for image generation screen ONLY */
    #image-generation-controls .form-group {
        display: flex;
        gap: 8px;
    }
    
    /* Back button takes less space */
    #image-generation-controls .form-group .btn-secondary {
        flex: 0 0 auto;
        min-width: auto;
        padding: 12px 16px;
    }
    
    /* Generate Images button takes more space (70-80%) */
    #image-generation-controls .form-group .btn-rainbow {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    /* On very small screens, stack buttons vertically */
    @media (max-width: 480px) {
        #image-generation-controls .form-group {
            flex-direction: column;
        }
        
        #image-generation-controls .form-group .btn-secondary,
        #image-generation-controls .form-group .btn-rainbow {
            width: 100%;
            flex: none;
        }
        
        /* Generate Images button slightly larger on mobile */
        #image-generation-controls .form-group .btn-rainbow {
            padding: 16px 24px;
            font-size: 16px;
        }
        
        #image-generation-controls .form-group .btn-secondary {
            padding: 12px 20px;
            font-size: 14px;
        }
    }
}

/* ========================================
   MODAL STYLES
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow);
    animation: slideUp 0.4s ease-out;
}

.modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 16px;
}

.modal-body {
    padding: 24px 32px;
}

.modal-body p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
}

.points-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.points-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
}

.points-info-item i {
    font-size: 24px;
    color: var(--primary);
    min-width: 30px;
    text-align: center;
}

.modal-footer {
    padding: 24px 32px 32px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.modal-footer .btn {
    flex: 0 0 auto;
    min-width: 140px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments for story action buttons */
@media (max-width: 768px) {
    .story-actions {
        grid-template-columns: 1fr;
    }
    
    .story-actions button,
    .story-actions .remix-badge {
        width: 100%;
        justify-content: center;
    }
    
    /* Keep inline action buttons in same line on mobile */
    .story-actions-inline {
        flex-direction: row;
        gap: 6px;
        flex-wrap: nowrap;
    }
    
    .story-actions-inline button {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        font-size: 13px;
        justify-content: center;
        white-space: nowrap;
    }
}

/* Extra small screens (iPhone SE, small phones) */
@media (max-width: 480px) {
    .story-actions-inline {
        gap: 4px;
    }
    
    .story-actions button {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .story-actions-inline button {
        padding: 8px 6px;
        font-size: 12px;
        flex: 1;
        min-width: 0;
    }
    
    .story-actions button i {
        font-size: 14px;
        margin-right: 6px;
    }
    
    .story-actions-inline button i {
        font-size: 12px;
        margin-right: 4px;
    }
    
    /* Ensure story meta doesn't wrap awkwardly */
    .story-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .story-actions {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    /* Fix form layout for tablet portrait mode */
    .form-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .form-hint {
        margin-left: 0;
        display: block;
        width: 100%;
    }
    
    /* Stack inspiration button properly on tablet */
    #generate-idea-btn {
        width: auto;
        min-width: 250px;
        max-width: 400px;
        margin: 8px auto 0 auto !important;
        display: block;
    }
}

/* Address Card Styles */
.address-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.address-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Icon Button Styles */
.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-icon:active {
    transform: translateY(0);
}

.btn-icon i {
    pointer-events: none;
}

/* ========================================
   SERIES COMPONENTS
   ======================================== */

/* Series Card Styles - Match Story Card Size */
.series-card {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
    cursor: pointer;
}

.series-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.series-card-image {
    position: relative;
    height: 280px;  /* Match story card thumbnail height */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.series-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-count-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.series-overlay-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    z-index: 2;
}

/* Stacked Books Effect for Series */
.series-thumbnail {
    overflow: visible !important;
    position: relative;
}

.series-stacked-books {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stacked-book {
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    background: #fff;
}

.stacked-book img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Position and rotate books to create stacked effect */
.stacked-book.book-1 {
    transform: translate(-8%, -4%) rotate(-4deg);
    z-index: 1;
}

.stacked-book.book-2 {
    transform: translate(0%, 0%) rotate(0deg);
    z-index: 2;
}

.stacked-book.book-3 {
    transform: translate(8%, 4%) rotate(4deg);
    z-index: 3;
}

/* Hover effect - spread the books slightly */
.story-card:hover .stacked-book.book-1 {
    transform: translate(-12%, -6%) rotate(-6deg);
}

.story-card:hover .stacked-book.book-2 {
    transform: translate(0%, 0%) rotate(0deg);
}

.story-card:hover .stacked-book.book-3 {
    transform: translate(12%, 6%) rotate(6deg);
}

/* For series with only 2 books */
.series-stacked-books:has(.book-2):not(:has(.book-3)) .stacked-book.book-1 {
    transform: translate(-6%, -3%) rotate(-3deg);
}

.series-stacked-books:has(.book-2):not(:has(.book-3)) .stacked-book.book-2 {
    transform: translate(6%, 3%) rotate(3deg);
}

/* For series with only 1 book */
.series-stacked-books:has(.book-1):not(:has(.book-2)) .stacked-book.book-1 {
    transform: translate(0%, 0%) rotate(0deg);
}

.series-card-info {
    padding: 16px;
}

.series-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-card-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Series Detail Screen */
#series-detail-screen .card {
    position: relative;
}

#series-detail-screen .card-header {
    flex-direction: column;
    text-align: center;
}

#series-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0;
}

/* Story Checkbox Items in Add Modal */
.story-checkbox-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.story-checkbox-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.story-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.story-checkbox-item label {
    flex: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Series Badge on Story Cards */
.series-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 6px;
    margin-top: 6px;
}

.series-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.series-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

