/* Communication Settings Admin Page - Mobile First Design */

/* Container */
.comm-settings-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.comm-header {
    margin-bottom: 2rem;
}

.comm-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.5rem 0;
}

.comm-description {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* Sections */
section {
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1.5rem 0;
}

/* Form Section - Mobile First */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

.form-control:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Form Check */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    cursor: pointer;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #0d6efd;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    margin: 0;
}

.form-check-input:hover {
    border-color: #0d6efd;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    color: #333;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #0d6efd;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0a58ca;
}

.btn-block {
    width: 100%;
}

.btn-delete {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #dc3545;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s ease;
    width: auto;
    line-height: 1;
}

.btn-delete:hover {
    color: #bb2d3b;
}

/* Alerts/Feedback */
.alert {
    padding: 0.875rem 1rem;
    margin-top: 1rem;
    border-radius: 0.375rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #51cf66;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f08080;
    color: #842029;
}

/* Loading/Empty States */
.loading-text,
.no-data-text {
    color: #666;
    font-size: 0.95rem;
    text-align: center;
    padding: 1rem;
    margin: 0;
}

.loading-text {
    font-style: italic;
}

/* Table Section */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 0.9rem;
}

.settings-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.settings-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.settings-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.15s ease;
}

.settings-table tbody tr:hover {
    background-color: #f8f9fa;
}

.settings-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.event-type-cell {
    font-weight: 500;
    color: #495057;
    max-width: 200px;
    word-break: break-word;
}

.channel-cell {
    text-align: left;
    font-size: 0.9rem;
}

.status-cell {
    text-align: left;
}

.inline-check {
    flex-direction: row;
    margin-bottom: 0;
}

.inline-check .form-check-input {
    margin-top: 0;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.status-enabled {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-disabled {
    background-color: #f8d7da;
    color: #842029;
}

.actions-cell {
    text-align: center;
    padding: 0.5rem;
}

/* Responsive Design - Tablet (768px) */
@media (min-width: 768px) {
    .comm-settings-page {
        padding: 2rem;
    }

    .comm-header h1 {
        font-size: 2rem;
    }

    section {
        padding: 2rem;
    }

    .settings-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .form-group:last-of-type {
        grid-column: 1 / -1;
    }

    .btn-block {
        grid-column: 1 / -1;
    }

    .settings-table {
        font-size: 0.95rem;
    }

    .settings-table th,
    .settings-table td {
        padding: 1rem;
    }
}

/* Responsive Design - Desktop (1024px) */
@media (min-width: 1024px) {
    .comm-settings-page {
        padding: 2.5rem;
    }

    .settings-form {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .form-group:nth-child(-n+2) {
        grid-column: span 1;
    }

    .form-group:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
    }

    .btn-block {
        grid-column: 1 / 2;
        grid-row: 2;
        align-self: flex-end;
        width: auto;
    }

    .settings-table {
        font-size: 1rem;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 479px) {
    .comm-settings-page {
        padding: 0.75rem;
    }

    .comm-header h1 {
        font-size: 1.5rem;
    }

    section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .form-control,
    .btn {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .settings-table {
        font-size: 0.85rem;
    }

    .settings-table th,
    .settings-table td {
        padding: 0.5rem;
    }

    .status-badge {
        display: block;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}
