/**
 * My Calendar Participation - Frontend Styles
 */

/* Participate Button */
.mcp-participate-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
}

.mcp-participate-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mcp-participate-button:hover,
.mcp-participate-button:focus {
    background-color: #005177;
    color: #fff;
    outline: 2px solid #005177;
    outline-offset: 2px;
}

/* Opt-out button styling */
.mcp-participate-button[data-participation-type="opt-out"] {
    background-color: #ffc107;
    color: #856404;
    border: 2px solid #e0a800;
}

.mcp-participate-button[data-participation-type="opt-out"]:hover,
.mcp-participate-button[data-participation-type="opt-out"]:focus {
    background-color: #e0a800;
    color: #856404;
    outline-color: #856404;
}

/* Modal */
.mcp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.mcp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.mcp-modal-content {
    position: relative;
    max-width: 500px;
    margin: 50px auto;
    padding: 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.mcp-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 28px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mcp-modal-close:hover,
.mcp-modal-close:focus {
    color: #000;
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    border-radius: 4px;
}

#mcp-modal-title {
    margin: 0;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 20px;
    font-weight: 600;
    background-color: #f9f9f9;
}

/* Opt-out modal styling */
.mcp-modal-optout #mcp-modal-title {
    background-color: #fff3cd;
    border-bottom-color: #ffc107;
    color: #856404;
}

.mcp-modal-optout .mcp-modal-content {
    border: 3px solid #ffc107;
}

.mcp-modal-body {
    padding: 25px;
}

/* Form */
#mcp-participate-form {
    margin: 0;
}

.mcp-form-group {
    margin-bottom: 20px;
}

.mcp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.mcp-form-group .mcp-group-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
}

.mcp-form-group .required {
    color: #dc3232;
}

/* Input fields */
.mcp-form-group input[type="text"],
.mcp-form-group input[type="email"],
.mcp-form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.mcp-form-group input[type="text"]:focus,
.mcp-form-group input[type="email"]:focus,
.mcp-form-group select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.mcp-form-group input.error,
.mcp-form-group select.error {
    border-color: #dc3232;
}

/* Messages */
.mcp-form-message {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
}

.mcp-form-message.error {
    background-color: #ffebee;
    border: 1px solid #dc3232;
    color: #dc3232;
}

.mcp-form-message.success {
    background-color: #e7f7ec;
    border: 1px solid #46b450;
    color: #46b450;
}

.mcp-form-message:empty {
    display: none;
}

/* Form Actions */
.mcp-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.mcp-submit-button,
.mcp-modal-cancel {
    flex: 1;
    min-width: 140px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Attend button (green) */
.mcp-btn-attending {
    background-color: #46b450;
    color: #fff;
}

.mcp-btn-attending:hover,
.mcp-btn-attending:focus {
    background-color: #2d8f37;
    outline: 2px solid #2d8f37;
    outline-offset: 2px;
}

/* Not attending button (orange/yellow) */
.mcp-btn-not-attending {
    background-color: #f0ad4e;
    color: #fff;
}

.mcp-btn-not-attending:hover,
.mcp-btn-not-attending:focus {
    background-color: #ec971f;
    outline: 2px solid #ec971f;
    outline-offset: 2px;
}

/* Old default submit button style (fallback) */
.mcp-submit-button:not(.mcp-btn-attending):not(.mcp-btn-not-attending) {
    background-color: #0073aa;
    color: #fff;
}

.mcp-submit-button:not(.mcp-btn-attending):not(.mcp-btn-not-attending):hover,
.mcp-submit-button:not(.mcp-btn-attending):not(.mcp-btn-not-attending):focus {
    background-color: #005177;
    outline: 2px solid #005177;
    outline-offset: 2px;
}

.mcp-submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.mcp-modal-cancel {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    flex-basis: 100%;
}

.mcp-modal-cancel:hover,
.mcp-modal-cancel:focus {
    background-color: #e5e5e5;
    outline: 2px solid #999;
    outline-offset: 2px;
}

/* Body Lock */
body.mcp-modal-open {
    overflow: hidden;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .mcp-modal-content {
        max-width: 90%;
        margin: 30px auto;
    }
    
    #mcp-modal-title {
        padding: 15px 20px;
        font-size: 18px;
    }
    
    .mcp-modal-body {
        padding: 20px;
    }
    
    .mcp-form-actions {
        flex-direction: column;
    }
    
    .mcp-submit-button,
    .mcp-modal-cancel {
        width: 100%;
        flex-basis: auto;
    }
}

/* Accessibility */
.mcp-modal:focus-within {
    outline: none;
}

.mcp-participate-button:focus-visible,
.mcp-submit-button:focus-visible,
.mcp-modal-cancel:focus-visible,
.mcp-modal-close:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.mcp-btn-attending:focus-visible {
    outline-color: #2d8f37;
}

.mcp-btn-not-attending:focus-visible {
    outline-color: #ec971f;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .mcp-participate-button,
    .mcp-submit-button {
        border: 2px solid currentColor;
    }
    
    .mcp-modal-content {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .mcp-participate-button,
    .mcp-submit-button,
    .mcp-modal-cancel,
    .mcp-modal-close,
    .mcp-form-group input,
    .mcp-form-group select {
        transition: none;
    }
}
