/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    margin: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-left h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.header-left p {
    color: #666;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(102, 126, 234, 0.1);
    padding: 15px 25px;
    border-radius: 25px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.user-details {
    text-align: right;
}

#headerUsername {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.balance-display {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Navigation par onglets */
.tabs-container {
    margin: 0 30px 30px 30px;
}

.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 8px;
    overflow-x: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    min-width: 150px;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Messages */
.message-container {
    margin: 0 30px 20px 30px;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: bold;
    animation: slideDown 0.3s ease-out;
}

.message-container.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-container.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none !important;
}

/* Contenu principal */
.main-content {
    margin: 0 30px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.tab-content.active {
    display: block;
}

.section-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.section-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 10px;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Grille de contenu */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* Cartes de contenu */
.content-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.content-card.premium {
    border: 2px solid #f39c12;
}

.premium-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.3);
}

.content-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4rem;
    padding-right: 80px; /* Espace pour le badge premium */
}

.content-card p {
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

.content-card .meta-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #888;
}

.content-price {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.price-tag {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* Boutons d'accès */
.access-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.access-btn.premium {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.access-btn.premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.access-btn.free {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.access-btn.free:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.access-btn.purchased {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Section communauté */
.post-form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.post-form-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.submit-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Publications */
.posts-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.posts-container h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.post-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.post-author-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.post-meta h4 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.post-date {
    color: #888;
    font-size: 0.9rem;
}

.post-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.post-content {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Commentaires */
.comments-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.comment-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.9rem;
}

.comment-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.comment-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.comment-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9rem;
}

.comment-date {
    color: #888;
    font-size: 0.8rem;
}

.comment-text {
    color: #555;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    margin: 3% auto;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

/* Modal de confirmation d'achat */
.purchase-modal {
    max-width: 500px;
}

.purchase-details {
    text-align: center;
    margin-bottom: 30px;
}

.purchase-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.purchase-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-btn:hover,
.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Messages d'état */
.no-content-message {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    grid-column: 1 / -1;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        margin: 10px;
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-left h1 {
        font-size: 2rem;
    }
    
    .tabs-container {
        margin: 0 10px 20px 10px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-btn {
        min-width: auto;
        text-align: center;
    }
    
    .main-content {
        margin: 0 10px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .purchase-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header-left h1 {
        font-size: 1.5rem;
    }
    
    .user-info {
        padding: 10px 15px;
    }
    
    .balance-display {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .content-card {
        padding: 20px;
    }
    
    .section-header {
        padding: 20px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
}
