/* ESA Squash - Styles Front-End */

/* Grille des compétitions */
.esa-competitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

/* Carte de compétition */
.esa-competition-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.esa-competition-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.esa-competition-header h3 {
    margin: 0 0 12px 0;
    font-size: 1.4em;
    color: #2c3e50;
}

.esa-competition-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.esa-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.85em;
    border-radius: 12px;
    font-weight: 500;
}

.esa-badge-type {
    background: #3498db;
    color: white;
}

.esa-badge-format {
    background: #9b59b6;
    color: white;
}

.esa-badge-level {
    background: #e67e22;
    color: white;
}

/* Contenu de la carte */
.esa-competition-content {
    margin-bottom: 16px;
}

.esa-competition-meta {
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.esa-meta-item {
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #555;
}

.esa-meta-item strong {
    color: #2c3e50;
}

.esa-registration-count {
    font-weight: bold;
    color: #27ae60;
}

.esa-full, .esa-deadline-passed {
    color: #e74c3c;
    font-weight: bold;
}

/* Actions */
.esa-competition-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* Boutons */
.esa-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.esa-btn-primary {
    background: #27ae60;
    color: white;
}

.esa-btn-primary:hover {
    background: #229954;
}

.esa-btn-secondary {
    background: #95a5a6;
    color: white;
}

.esa-btn-secondary:hover {
    background: #7f8c8d;
}

.esa-btn-disabled {
    background: #ecf0f1;
    color: #95a5a6;
    cursor: not-allowed;
}

.esa-btn-link {
    background: transparent;
    color: #3498db;
    border: 1px solid #3498db;
}

.esa-btn-link:hover {
    background: #3498db;
    color: white;
}

/* Messages */
.esa-competition-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.esa-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.esa-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login requis */
.esa-login-required {
    font-size: 0.9em;
    color: #555;
}

.esa-login-required a {
    color: #3498db;
    text-decoration: none;
}

.esa-login-required a:hover {
    text-decoration: underline;
}

/* Page détails */
.esa-competition-single {
    max-width: 900px;
    margin: 0 auto;
}

.esa-competition-description {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.esa-competition-description h2 {
    margin-top: 0;
    color: #2c3e50;
}

/* Participants */
.esa-competition-participants {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.esa-participants-list {
    list-style: none;
    padding: 0;
}

.esa-participants-list li {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.esa-participants-list li:last-child {
    border-bottom: none;
}

.esa-message-user {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
    margin-left: 10px;
}

.esa-message-user:hover {
    text-decoration: underline;
}

/* Formulaire de message */
.esa-message-form-wrapper {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.esa-message-form-wrapper h3 {
    margin-top: 0;
    color: #2c3e50;
}

.esa-form-group {
    margin-bottom: 16px;
}

.esa-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
}

.esa-form-group input[type="text"],
.esa-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
}

.esa-form-group input[type="text"]:focus,
.esa-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.esa-message-response {
    margin-top: 12px;
}

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

.esa-modal {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.esa-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #95a5a6;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.esa-modal-close:hover {
    color: #2c3e50;
}

.esa-modal h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* Mes compétitions */
.esa-my-competitions h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Message vide */
.esa-no-competitions {
    text-align: center;
    padding: 40px 20px;
    color: #95a5a6;
    font-size: 1.1em;
}

/* Responsive */
@media (max-width: 768px) {
    .esa-competitions-grid {
        grid-template-columns: 1fr;
    }
    
    .esa-competition-actions {
        flex-direction: column;
    }
    
    .esa-btn {
        width: 100%;
    }
}