/* Church Manager Frontend Styles */

/* Event listing */
.cm-events-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cm-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.cm-event-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.cm-event-card .cm-event-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.cm-event-content {
    padding: 16px;
}

.cm-event-title {
    margin: 0 0 8px;
    font-size: 1.25em;
    line-height: 1.3;
}

.cm-event-date {
    color: #555;
    margin: 0 0 6px;
    font-size: 0.9em;
}

.cm-event-location {
    color: #666;
    margin: 0 0 6px;
    font-size: 0.9em;
}

.cm-event-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    color: #fff;
    margin: 4px 0;
}

.cm-event-signups {
    color: #555;
    font-size: 0.85em;
    margin: 6px 0 0;
}

.cm-event-recurrence {
    color: #666;
    font-size: 0.85em;
    font-style: italic;
    margin: 4px 0 0;
}

.cm-events-empty {
    text-align: center;
    padding: 30px;
    color: #666;
}

.cm-event-member-only {
    opacity: 0.7;
}

.cm-event-login-prompt {
    font-style: italic;
    color: #888;
}

/* Single event */
.cm-event-single {
    max-width: 800px;
}

.cm-event-single .cm-event-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 20px;
}

.cm-event-single .cm-event-title {
    font-size: 1.75em;
    margin-bottom: 16px;
}

.cm-event-single p {
    margin: 8px 0;
    line-height: 1.5;
}

.cm-event-description {
    margin: 20px 0;
    line-height: 1.6;
}

/* Signup section */
.cm-event-signup-section {
    margin-top: 30px;
    padding: 20px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.cm-event-signup-section h3 {
    margin-top: 0;
}

.cm-event-capacity {
    font-size: 0.9em;
    color: #555;
}

.cm-event-full {
    color: #b32d2e;
    font-weight: 600;
}

.cm-event-already-signed-up {
    color: #2e7d32;
    font-weight: 600;
}

/* Signup form */
.cm-signup-form .cm-form-field {
    margin-bottom: 12px;
}

.cm-signup-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.cm-signup-form input[type="text"],
.cm-signup-form input[type="email"],
.cm-signup-form input[type="number"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

.cm-signup-button {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 8px;
}

.cm-signup-button:hover {
    background: #135e96;
}

.cm-signup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.cm-signup-message {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 0.95em;
}

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

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

/* My Rotas */
.cm-my-rotas {
    max-width: 800px;
}

.cm-my-rotas h3 {
    margin-top: 30px;
    margin-bottom: 12px;
}

.cm-my-rotas h3:first-child {
    margin-top: 0;
}

.cm-rota-table,
.cm-unavail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cm-rota-table th,
.cm-rota-table td,
.cm-unavail-table th,
.cm-unavail-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95em;
}

.cm-rota-table th,
.cm-unavail-table th {
    font-weight: 600;
    background: #f7f7f7;
}

.cm-rota-table tbody tr:hover,
.cm-unavail-table tbody tr:hover {
    background: #fafafa;
}

/* Unavailability */
.cm-unavail-remove {
    background: none;
    border: 1px solid #b32d2e;
    color: #b32d2e;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
}

.cm-unavail-remove:hover {
    background: #b32d2e;
    color: #fff;
}

.cm-add-unavailability {
    margin-top: 20px;
}

.cm-unavailability-form {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
}

.cm-unavailability-form .cm-form-field {
    margin-bottom: 12px;
}

.cm-unavailability-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.cm-unavailability-form input[type="date"],
.cm-unavailability-form input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

.cm-login-required {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* My Groups */
.cm-my-groups {
    max-width: 800px;
}

.cm-my-groups h3 {
    margin-top: 30px;
    margin-bottom: 12px;
}

.cm-my-groups h3:first-child {
    margin-top: 0;
}

.cm-my-groups h4 {
    margin-top: 20px;
    margin-bottom: 8px;
}

.cm-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.cm-group-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.cm-group-card-content {
    padding: 16px;
}

.cm-group-card-name {
    margin: 0 0 8px;
    font-size: 1.1em;
    line-height: 1.3;
}

.cm-group-card-type {
    color: #555;
    margin: 0 0 4px;
    font-size: 0.85em;
}

.cm-group-card-role {
    color: #2271b1;
    font-weight: 600;
    margin: 0 0 4px;
    font-size: 0.9em;
}

.cm-group-card-day {
    color: #666;
    margin: 0;
    font-size: 0.85em;
}

.cm-child-groups-list {
    list-style: disc;
    padding-left: 20px;
    margin: 8px 0 16px;
}

.cm-child-groups-list li {
    margin-bottom: 4px;
    font-size: 0.95em;
}

.cm-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
}

.cm-status-pending {
    background: #fff3cd;
    color: #856404;
}

.cm-status-approved {
    background: #d4edda;
    color: #155724;
}

.cm-status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Group Registration Form */
.cm-group-register {
    max-width: 600px;
}

.cm-group-register h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.cm-group-register-type {
    color: #555;
    margin: 0 0 12px;
    font-size: 0.9em;
}

.cm-group-register-desc {
    margin: 0 0 20px;
    line-height: 1.6;
    color: #333;
}

.cm-registration-form .cm-form-field {
    margin-bottom: 14px;
}

.cm-registration-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.cm-registration-form select,
.cm-registration-form input[type="text"],
.cm-registration-form input[type="tel"],
.cm-registration-form textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: inherit;
}

.cm-registration-form textarea {
    resize: vertical;
}

.cm-registration-form select {
    max-width: 420px;
}
