/* Story Storage Manager Frontend Styles */

.ssm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Header */
.ssm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.ssm-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 600;
}

.ssm-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ssm-filter {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ssm-filter:hover,
.ssm-filter:focus {
    border-color: #3498db;
    outline: none;
}

/* Buttons */
.ssm-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ssm-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ssm-button.ssm-primary {
    background: #3498db;
    color: white;
}

.ssm-button.ssm-primary:hover {
    background: #2980b9;
    color: white;
}

.ssm-button.ssm-secondary {
    background: #6c757d;
    color: white;
}

.ssm-button.ssm-secondary:hover {
    background: #5a6268;
    color: white;
}

.ssm-button.ssm-danger {
    background: #e74c3c;
    color: white;
}

.ssm-button.ssm-danger:hover {
    background: #c0392b;
    color: white;
}

.ssm-button.ssm-success {
    background: #27ae60;
    color: white;
}

.ssm-button.ssm-success:hover {
    background: #229954;
    color: white;
}

.ssm-button.ssm-warning {
    background: #f39c12;
    color: white;
}

.ssm-button.ssm-warning:hover {
    background: #e67e22;
    color: white;
}

.ssm-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

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

.ssm-story-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #3498db;
}

.ssm-story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.ssm-story-card.category-children {
    border-left-color: #e74c3c;
}

.ssm-story-card.category-adult {
    border-left-color: #9b59b6;
}

.ssm-story-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ssm-story-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    margin-right: 10px;
}

.ssm-story-category {
    background: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.ssm-story-category.category-children {
    background: #ffe6e6;
    color: #e74c3c;
}

.ssm-story-category.category-adult {
    background: #f3e5f5;
    color: #9b59b6;
}

.ssm-story-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.ssm-story-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ssm-story-size {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ssm-story-excerpt {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 20px;
    white-space: pre-line;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.ssm-story-excerpt:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, #f8f9fa);
}

.ssm-story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ssm-story-actions .ssm-button {
    font-size: 0.9rem;
    padding: 8px 15px;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

/* Loading States */
.ssm-loading {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.ssm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: ssm-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes ssm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.ssm-error {
    background: #ffe6e6;
    color: #e74c3c;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 20px;
}

.ssm-error p {
    margin: 0;
    font-weight: 500;
}

/* Empty State */
.ssm-empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #7f8c8d;
}

.ssm-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.ssm-empty-state h4 {
    font-size: 1.5rem;
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.ssm-empty-state p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.ssm-empty-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Titel-Bearbeitung */
.story-title.editable-title:hover {
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
}

.story-title-edit {
    border: 2px solid #0073aa !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-family: inherit !important;
}

/* Forum-Button */
.forum-btn {
    background-color: #16a085;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 4px;
}

.forum-btn:hover {
    background-color: #138d75;
}

/* Forum-Modal */
.ssm-forum-modal .ssm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ssm-forum-modal .ssm-modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.ssm-forum-modal .form-group {
    margin: 16px 0;
}

.ssm-forum-modal label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.ssm-forum-modal select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ssm-forum-modal .modal-buttons {
    margin-top: 20px;
    text-align: right;
}

.ssm-forum-modal .btn-primary {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    margin-left: 8px;
    cursor: pointer;
}

.ssm-forum-modal .btn-secondary {
    background: #ccc;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.ssm-forum-modal .forum-info {
    margin-top: 12px;
    padding: 8px;
    background: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

/* Premium Hint */
.ssm-premium-hint {
    margin-top: 30px;
}

.ssm-upgrade-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.ssm-upgrade-box h4 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.ssm-upgrade-box p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.ssm-upgrade-box a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.ssm-upgrade-box a:hover {
    color: #f8f9fa;
}

/* Modal */
.ssm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ssm-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ssm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e9ecef;
}

.ssm-modal-header h4 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.ssm-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    color: #7f8c8d;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.ssm-modal-close:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.ssm-modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Share Content */
.ssm-share-box {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.ssm-share-url {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ssm-share-url:hover {
    background: #e9ecef;
}

.ssm-share-text {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-line;
    margin-bottom: 15px;
}

.ssm-share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ssm-share-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 15px;
    font-size: 0.9rem;
    color: #0c5460;
    margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ssm-container {
        padding: 15px;
    }
    
    .ssm-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .ssm-controls {
        justify-content: center;
    }
    
    .ssm-stories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ssm-story-card {
        padding: 20px;
    }
    
    .ssm-story-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .ssm-story-title {
        margin-right: 0;
    }
    
    .ssm-story-actions {
        gap: 8px;
    }
    
    .ssm-story-actions .ssm-button {
        min-width: 100px;
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .ssm-empty-links {
        flex-direction: column;
        align-items: center;
    }
    
    .ssm-modal {
        padding: 10px;
    }
    
    .ssm-modal-content {
        max-height: 90vh;
    }
    
    .ssm-modal-header,
    .ssm-modal-body {
        padding: 20px;
    }
    
    .ssm-share-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .ssm-story-actions {
        flex-direction: column;
    }
    
    .ssm-story-actions .ssm-button {
        min-width: auto;
    }
    
    .ssm-story-meta {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}