﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #2c2c2c 0%, #4b2e39 100%);
    color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.5s ease;
}
body.light-mode {
    background: linear-gradient(135deg, #f5f5f5 0%, #d9c2cc 100%);
    color: #2c2c2c;
}
body.light-mode .section {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
body.light-mode .story-card {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
body.light-mode .story-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
body.light-mode .dashboard-content {
    background: rgba(255, 255, 255, 0.9);
}
body.light-mode .dashboard-tab.active {
    background: rgba(255, 255, 255, 0.2);
}
header {
    padding: 40px 20px;
    text-align: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    position: relative;
}
header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3em;
    font-weight: 700;
    margin: 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #e74c3c, #ff6f61);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
header p {
    font-size: 1.1em;
    color: #cccccc;
    margin-top: 5px;
}
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #f5f5f5;
    font-size: 1.8em;
    cursor: pointer;
    transition: transform 0.3s;
}
body.light-mode .theme-toggle {
    color: #2c2c2c;
}
.theme-toggle:hover {
    transform: rotate(20deg);
}
.theme-toggle:focus {
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
.container {
    max-width: 900px;
    width: 90%;
    padding: 40px 20px;
    flex-grow: 1;
}
.section {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8em;
    margin-top: 0;
    color: #e74c3c;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 10px;
}
.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}
input, textarea, select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 1em;
    margin-bottom: 15px;
    box-sizing: border-box;
    transition: background 0.3s, box-shadow 0.3s;
}
input:focus, textarea:focus, select:focus {
    background: #ffffff;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
select {
    width: auto;
    padding: 10px;
}
body.light-mode input, body.light-mode textarea, body.light-mode select {
    background: #e8e8e8;
    color: #333;
}
.error-input {
    border: 2px solid #e74c3c;
}
textarea {
    height: 180px;
    resize: vertical;
}
button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
button:disabled {
    background: #666;
    cursor: not-allowed;
    box-shadow: none;
}
button:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
button:focus {
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
.sign-out-button {
    background: #2c3e50;
    margin-top: 15px;
    width: 100%;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
}
.sign-out-button:hover {
    background: #34495e;
    transform: scale(1.02);
}
body.light-mode .sign-out-button {
    background: #34495e;
}
body.light-mode .sign-out-button:hover {
    background: #2c3e50;
}
.story-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.story-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5em;
    margin: 0 0 10px 0;
    color: #ff6f61;
}
.story-card p {
    margin: 8px 0;
    font-size: 0.95em;
    line-height: 1.6;
}
.story-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #cccccc;
}
.category-tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    color: #fff;
    font-weight: 500;
}
.category-erotic { background: #e74c3c; }
.category-romantic { background: #ff6f61; }
.category-suspense { background: #2c3e50; }
.category-fantasy { background: #8e44ad; }
.category-humor { background: #f1c40f; color: #333; }
.category-drama { background: #7f8c8d; }
.category-other { background: #95a5a6; }
.sensitive-content {
    filter: blur(3px);
    transition: filter 0.3s;
}
.sensitive-content-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    color: #fff;
    transition: background 0.3s;
}
.sensitive-content-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
}
.sensitive-content-toggle:focus {
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
.story-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.story-actions button {
    padding: 8px 15px;
    font-size: 0.9em;
}
.like-button {
    background: #2c3e50;
    transition: background 0.3s, color 0.3s;
}
.like-button.liked {
    background: #e74c3c;
    color: #fff;
}
.like-button.liked i {
    color: #fff;
}
.like-button:hover:not(.liked) {
    background: #34495e;
}
.like-count {
    margin-left: 5px;
}
.audio-section {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.audio-section i {
    color: #e74c3c;
    font-size: 1.2em;
}
audio {
    max-width: 100%;
    border-radius: 5px;
}
.comments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}
.comments-section.active {
    display: block;
    animation: slideDown 0.3s ease;
}
.toggle-comments {
    background: #2c3e50;
    padding: 8px 15px;
    margin-top: 10px;
    font-size: 0.9em;
}
.toggle-comments:hover {
    background: #34495e;
}
.comment {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.comment p {
    margin: 5px 0;
    font-size: 0.9em;
}
.comment-form {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comment-input {
    height: 80px;
    resize: vertical;
}
.submit-comment {
    background: #e74c3c;
    align-self: flex-start;
}
.submit-comment:hover {
    background: #c0392b;
}
.hidden {
    display: none;
}
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: #fff;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.notification.success {
    background: #27ae60;
}
.notification.error {
    background: #e74c3c;
}
.notification.show {
    opacity: 1;
}
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.scroll-to-top.visible {
    opacity: 1;
}
.scroll-to-top:hover {
    transform: scale(1.1);
}
.scroll-to-top:focus {
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
.dashboard-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-family: 'Montserrat', sans-serif;
    background: #2c3e50;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}
.dashboard-toggle:hover {
    background: #34495e;
}
.dashboard-toggle:focus {
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
.dashboard-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}
.dashboard-content-wrapper.open {
    max-height: none;
}
.dashboard {
    display: flex;
    gap: 20px;
}
.dashboard-tabs {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dashboard-tab {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    text-align: left;
}
.dashboard-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}
.dashboard-tab:focus {
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
.dashboard-tab.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 4px solid #ff6f61;
}
.dashboard-tab h3 {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3em;
    color: #ff6f61;
}
.dashboard-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}
.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #e74c3c;
}
.profile-picture-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: #fff;
    font-size: 2em;
}
.user-story {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.user-story h4 {
    margin: 0 0 10px 0;
    color: #ff6f61;
    font-family: 'Montserrat', sans-serif;
}
/* Estils per al text de previsualització i botons "Llegir més" / "Tancar" */
.story-text-preview {
    max-height: 60px;
    overflow: hidden;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 8px 0;
    position: relative;
}
.story-text-preview::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.03));
    padding-left: 10px;
}
body.light-mode .story-text-preview::after {
    background: linear-gradient(to right, transparent, #ffffff);
}
.story-text-full {
    font-size: 0.95em;
    line-height: 1.6;
    margin: 8px 0;
}
.read-more-button, .read-less-button {
    background: #2c3e50;
    padding: 8px 15px;
    font-size: 0.9em;
    margin-top: 10px;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, transform 0.2s;
    display: inline-flex;
}
.read-more-button:hover, .read-less-button:hover {
    background: #34495e;
    transform: translateY(-2px);
}
.read-more-button:focus, .read-less-button:focus {
    outline: 2px solid #ff6f61;
    outline-offset: 2px;
}
@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }
    header p {
        font-size: 0.9em;
    }
    .container {
        width: 95%;
        padding: 20px;
    }
    textarea {
        height: 150px;
    }
    .filter-section {
        flex-direction: column;
        gap: 10px;
    }
    select {
        width: 100%;
    }
    .section {
        padding: 15px;
    }
    .story-card {
        padding: 15px;
    }
    .dashboard {
        flex-direction: column;
    }
    .dashboard-tabs {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    .dashboard-tab {
        flex: 1;
        text-align: center;
        padding: 10px;
    }
    .dashboard-tab h3 {
        font-size: 1.1em;
    }
    .dashboard-tab.active {
        border-left: none;
        border-bottom: 4px solid #ff6f61;
    }
    .dashboard-content {
        padding: 15px;
    }
}