/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

.text-muted {
    color: #6c757d;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* Login Container */
.container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #25D366;
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: 600;
}

.logo p {
    color: #666;
    font-size: 16px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background-color: #128C7E;
    transform: translateY(-1px);
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-full {
    width: 100%;
}

/* Alert Styles */
.error,
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

.error,
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading {
    text-align: center;
    margin: 10px 0;
    color: #666;
}

/* Dashboard Layout */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header h1 {
    color: #25D366;
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
    font-weight: 500;
}

/* Navigation */
.nav-tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden;
}

.nav-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-tab:hover {
    background-color: #f8f9fa;
    color: #333;
}

.nav-tab.active {
    background-color: #25D366;
    color: white;
}

.nav-tab i {
    font-size: 18px;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #25D366;
}

/* Status Cards */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.status-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #25D366;
}

.status-card.warning {
    border-left-color: #ffc107;
}

.status-card.danger {
    border-left-color: #dc3545;
}

.status-card h3 {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.status-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.status-icon.online {
    background-color: #d4edda;
    color: #28a745;
}

.status-icon.offline {
    background-color: #f8d7da;
    color: #dc3545;
}

.status-icon.warning {
    background-color: #fff3cd;
    color: #ffc107;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #25D366;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Force modal to center when shown via JavaScript */
.modal[style*="display: block"],
.modal[style*="display:block"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure modal content is properly positioned */
.modal-content {
    position: relative;
    margin: auto;
    transform: none;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #333;
}

/* Add Groups Modal Specific Styles */
#addGroupsModal .modal-content {
    max-width: 600px;
    max-height: 80vh;
}

.groups-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.group-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.group-item:hover {
    background-color: #e9ecef;
    border-color: #25D366;
}

.group-item.selected {
    background-color: #d4edda;
    border-color: #25D366;
}

.group-checkbox {
    margin-right: 12px;
    transform: scale(1.2);
}

.group-info {
    flex: 1;
}

.group-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.group-details {
    font-size: 12px;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.group-id {
    font-family: 'Courier New', monospace;
    background-color: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.group-participants {
    color: #25D366;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

/* Button spacing in groups tab */
#addGroupsBtn {
    margin-left: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #addGroupsModal .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 20px;
    }

    .group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .group-checkbox {
        margin-right: 0;
        margin-bottom: 8px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #25D366;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-tabs {
        flex-direction: column;
    }

    .nav-tab {
        border-bottom: 1px solid #e9ecef;
    }

    .nav-tab:last-child {
        border-bottom: none;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .container {
        margin: 20px auto;
        padding: 20px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
    }

    .nav-tab {
        font-size: 14px;
        padding: 12px 15px;
    }

    .status-card {
        padding: 20px;
    }

    .status-value {
        font-size: 20px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        transform: translate3d(0, -10px, 0);
    }

    70% {
        transform: translate3d(0, -5px, 0);
    }

    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #25D366;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Form Validation */
.form-group.error input {
    border-color: #dc3545;
}

.form-group.error .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

.form-group.success input {
    border-color: #28a745;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-secondary {
    background-color: #e9ecef;
    color: #495057;
}

/* QR Code Section */
.qr-code-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #25D366;
}

.qr-code-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.qr-code-instructions {
    padding: 20px;
}

.qr-code-instructions h3 {
    color: #25D366;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.qr-code-instructions ol {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
}

.qr-code-instructions li {
    counter-increment: step-counter;
    margin-bottom: 15px;
    padding-left: 40px;
    position: relative;
    line-height: 1.5;
}

.qr-code-instructions li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #25D366;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.qr-code-display {
    text-align: center;
    padding: 20px;
}

.qr-code-image {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-code-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.qr-code-image .spinner {
    margin-bottom: 15px;
}

.qr-code-status {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #e3f2fd;
    border-radius: 8px;
    color: #1976d2;
    font-weight: 500;
}

.qr-code-status.success {
    background: #e8f5e8;
    color: #2e7d32;
}

.qr-code-status.error {
    background: #ffebee;
    color: #c62828;
}

.qr-code-status.warning {
    background: #fff3e0;
    color: #ef6c00;
}

/* Responsive QR Code */
@media (max-width: 768px) {
    .qr-code-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .qr-code-instructions {
        order: 2;
        padding: 10px;
    }

    .qr-code-display {
        order: 1;
        padding: 10px;
    }

    .qr-code-image {
        min-height: 250px;
        padding: 20px;
    }

    .qr-code-instructions li {
        padding-left: 35px;
        font-size: 14px;
    }

    .qr-code-instructions li::before {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
}

/* A
dd Groups Modal Specific Styles */
#addGroupsModal .modal-content {
    max-width: 600px;
    max-height: 80vh;
}

.groups-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.group-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.group-item:hover {
    background-color: #e9ecef;
    border-color: #25D366;
}

.group-item.selected {
    background-color: #d4edda;
    border-color: #25D366;
}

.group-checkbox {
    margin-right: 12px;
    transform: scale(1.2);
}

.group-info {
    flex: 1;
}

.group-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.group-details {
    font-size: 12px;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.group-id {
    font-family: 'Courier New', monospace;
    background-color: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.group-participants {
    color: #25D366;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading .spinner {
    margin: 0 auto 15px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

/* Button spacing in groups tab */
#addGroupsBtn {
    margin-left: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #addGroupsModal .modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
        padding: 20px;
    }

    .group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .group-checkbox {
        margin-right: 0;
        margin-bottom: 8px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}

/* Wha
tsApp Controls */
.whatsapp-controls {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.control-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.control-card h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.account-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    font-size: 12px;
}

.status-indicator.connected {
    color: #28a745;
}

.status-indicator.disconnected {
    color: #dc3545;
}

.status-indicator.connecting {
    color: #ffc107;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

/*
 Discord Mapping Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-header .close:hover {
    background-color: #f8f9fa;
    color: #333;
}

.modal form {
    padding: 24px;
}

.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.modal .form-group select,
.modal .form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.modal .form-group select:focus,
.modal .form-group input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.modal .form-group select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.modal .form-group label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-secondary {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Button Group Styles */
.btn-group {
    display: inline-flex;
    gap: 4px;
}

.btn-group .btn {
    margin: 0;
}

/* Enhanced Table Styles for Discord Mappings */
.table-container table td:last-child {
    white-space: nowrap;
}

.table-container table td:last-child .btn {
    margin-right: 4px;
}

.table-container table td:last-child .btn:last-child {
    margin-right: 0;
}

/* Loading and Error States */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
}

.error.hidden {
    display: none;
}

/* Toast Notifications */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert {
    position: relative;
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-header {
        padding: 16px 20px 12px;
    }

    .modal form {
        padding: 20px;
    }

    .modal-title {
        font-size: 1.1rem;
    }
}

/* Enhanced Form Validation Styles */
.form-group.error input,
.form-group.error select {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Discord Tab Specific Styles */
#discordTab .section-title {
    margin-bottom: 20px;
}

#discordTab .mb-3 {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#discordTab .table-container {
    margin-top: 20px;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin: 8px 0;
}

.empty-state p:first-of-type {
    font-size: 18px;
    font-weight: 500;
    color: #495057;
}

/* Group Members Styles */
.member-count {
    font-weight: bold;
    color: #495057;
}

/* Media and Transcription Indicators */
.media-transcription-indicators {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

.media-transcription-indicators .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: fit-content;
}

.media-transcription-indicators .badge i {
    font-size: 0.7rem;
}

.media-transcription-indicators .badge-info {
    background-color: #17a2b8;
    color: white;
}

.media-transcription-indicators .badge-success {
    background-color: #28a745;
    color: white;
}

.media-transcription-indicators .badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.media-transcription-indicators .badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Button Group Vertical */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.btn-group-vertical .btn {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Enhanced Groups Table */
#groupsTable {
    font-size: 0.875rem;
}

#groupsTable th {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

#groupsTable td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

#groupsTable td:first-child {
    text-align: left;
    min-width: 200px;
}

#groupsTable td:nth-child(2) {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    word-break: break-all;
    max-width: 150px;
}

#groupsTable td:nth-child(3) {
    text-align: center;
    min-width: 80px;
}

#groupsTable td:nth-child(4) {
    text-align: center;
    min-width: 120px;
}

#groupsTable td:nth-child(5),
#groupsTable td:nth-child(6) {
    text-align: center;
    min-width: 80px;
}

#groupsTable td:last-child {
    text-align: center;
    min-width: 120px;
}

.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 0.2rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.role-admin {
    color: #fff;
    background-color: #007bff;
}

.role-member {
    color: #495057;
    background-color: #e9ecef;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.status-active {
    color: #fff;
    background-color: #28a745;
}

.status-inactive {
    color: #fff;
    background-color: #6c757d;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    color: #fff;
    background-color: #007bff;
}

/* Group Members Modal Specific Styles */
#groupMembersModal .modal-content {
    max-width: 900px;
    width: 90%;
}

#groupMembersModal .table-container {
    max-height: 400px;
    overflow-y: auto;
}

#groupMembersInfo h3 {
    color: #495057;
    margin-bottom: 0.5rem;
}

#groupMembersInfo p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Responsive adjustments for group members */
@media (max-width: 768px) {
    #groupMembersModal .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .btn-xs {
        padding: 0.1rem 0.2rem;
        font-size: 0.7rem;
    }

    .role-badge,
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Import History Modal Styles */
#importHistoryModal .modal-content {
    max-width: 600px;
    width: 90%;
}

.progress-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #25D366, #128C7E);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(-45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 50px 50px;
    }
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.progress-item span:first-child {
    font-weight: 500;
    color: #666;
}

.progress-item span:last-child {
    font-weight: 600;
    color: #333;
}

.import-actions {
    text-align: center;
    margin-top: 20px;
}

.import-report {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.report-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.report-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.report-status.success {
    background: #d4edda;
    color: #155724;
}

.report-status.warning {
    background: #fff3cd;
    color: #856404;
}

.report-status.error {
    background: #f8d7da;
    color: #721c24;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.summary-item i {
    font-size: 20px;
    color: #25D366;
}

.summary-item span {
    color: #666;
    font-weight: 500;
}

.summary-item strong {
    color: #333;
    font-size: 18px;
    margin-left: auto;
}

.errors-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.errors-list h5 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 16px;
}

.error-item {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.error-item .error-type {
    font-weight: 600;
    color: #c53030;
    margin-bottom: 5px;
}

.error-item .error-message {
    color: #744210;
    font-size: 14px;
    line-height: 1.4;
}

.error-item .error-context {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-family: 'Courier New', monospace;
    background: #f7fafc;
    padding: 5px 8px;
    border-radius: 4px;
}

.report-actions {
    text-align: center;
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* File input styling */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.form-control[type="file"] {
    padding: 8px 12px;
}

/* Responsive adjustments for import modal */
@media (max-width: 768px) {
    #importHistoryModal .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }

    .progress-details {
        grid-template-columns: 1fr;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }

    .summary-item {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .summary-item strong {
        margin-left: 0;
        font-size: 24px;
    }

    .report-actions {
        flex-direction: column;
    }

    .report-actions .btn {
        width: 100%;
    }
}

/* Message Items Styles */
.message-item {
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fff;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f8f9fa;
}

.message-timestamp {
    font-size: 0.8rem;
    color: #6c757d;
}

.message-indicators {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.message-content {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.transcribed-content {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin: 0.5rem 0;
}

.transcription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.transcription-badges {
    display: flex;
    gap: 0.5rem;
}

.confidence-score {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.transcription-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.transcription-text {
    margin: 0.5rem 0;
    font-style: italic;
    color: #495057;
}

.transcription-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
}

.low-confidence-warning {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #856404;
}

.message-media {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f8f9fa;
}

/* Enhanced Media Content Styles */
.media-content {
    margin: 0.75rem 0;
}

.media-gallery-item {
    position: relative;
    display: inline-block;
    max-width: 300px;
}

.media-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.media-image:hover {
    transform: scale(1.02);
}

.media-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-gallery-item:hover .media-overlay {
    opacity: 1;
}

.media-video-container {
    max-width: 400px;
}

.media-video {
    width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

.enhanced-audio-player {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.media-audio {
    width: 100%;
}

.audio-controls {
    display: flex;
    gap: 0.5rem;
}

.media-info {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

.media-filename {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.media-size {
    font-size: 0.8rem;
    color: #6c757d;
    margin-right: 0.5rem;
}

.media-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.media-document {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.document-icon {
    font-size: 2rem;
    color: #6c757d;
}

.document-info {
    flex: 1;
}

.media-placeholder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    color: #6c757d;
}

/* Image Modal Styles */
.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* Media Gallery Modal Styles */
.media-gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.media-gallery-container .media-content {
    margin: 0;
}

/* Audio Player Modal Styles */
.modal-audio {
    width: 100%;
    margin: 1rem 0;
}

.messages-container {
    max-height: 500px;
    overflow-y: auto;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.message-filters {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #495057;
}

.filter-input {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.filter-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced Groups Table Responsive Design */
@media (max-width: 1200px) {
    #groupsTable td:nth-child(2) {
        max-width: 120px;
        font-size: 0.65rem;
    }

    .btn-group-vertical .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    .media-transcription-indicators .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
}

@media (max-width: 992px) {
    #groupsTable {
        font-size: 0.8rem;
    }

    #groupsTable th,
    #groupsTable td {
        padding: 0.5rem 0.3rem;
    }

    #groupsTable td:first-child {
        min-width: 150px;
    }

    #groupsTable td:nth-child(2) {
        max-width: 100px;
        font-size: 0.6rem;
    }

    #groupsTable td:nth-child(4) {
        min-width: 100px;
    }

    .media-transcription-indicators {
        gap: 0.15rem;
    }

    .media-transcription-indicators .badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
    }

    .btn-group-vertical {
        gap: 0.15rem;
    }

    .btn-group-vertical .btn {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
}

@media (max-width: 768px) {

    /* Stack table content vertically on mobile */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #groupsTable {
        min-width: 800px;
        /* Ensure table doesn't get too cramped */
        font-size: 0.75rem;
    }

    #groupsTable th {
        font-size: 0.7rem;
        padding: 0.5rem 0.25rem;
    }

    #groupsTable td {
        padding: 0.5rem 0.25rem;
    }

    #groupsTable td:first-child {
        min-width: 120px;
    }

    #groupsTable td:nth-child(2) {
        max-width: 80px;
        font-size: 0.55rem;
    }

    #groupsTable td:nth-child(3),
    #groupsTable td:nth-child(4) {
        min-width: 90px;
    }

    #groupsTable td:nth-child(5),
    #groupsTable td:nth-child(6) {
        min-width: 60px;
    }

    #groupsTable td:last-child {
        min-width: 100px;
    }

    .media-transcription-indicators .badge {
        font-size: 0.55rem;
        padding: 0.1rem 0.2rem;
    }

    .btn-group-vertical .btn {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
    }

    .member-count {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    #groupsTable {
        min-width: 700px;
        font-size: 0.7rem;
    }

    #groupsTable th {
        font-size: 0.65rem;
        padding: 0.4rem 0.2rem;
    }

    #groupsTable td {
        padding: 0.4rem 0.2rem;
    }

    .media-transcription-indicators .badge {
        font-size: 0.5rem;
        padding: 0.08rem 0.15rem;
    }

    .btn-group-vertical .btn {
        font-size: 0.55rem;
        padding: 0.08rem 0.2rem;
    }

    /* Media content responsive adjustments */
    .media-content {
        margin: 0.5rem 0;
    }

    .media-gallery-item {
        max-width: 100%;
    }

    .media-video-container {
        max-width: 100%;
    }

    .enhanced-audio-player {
        max-width: 100%;
    }

    .media-info {
        padding: 0.4rem;
    }

    .media-filename {
        font-size: 0.8rem;
    }

    .media-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .media-actions .btn {
        width: 100%;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .transcription-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .transcription-badges {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .transcription-actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .transcription-actions .btn {
        width: 100%;
        font-size: 0.7rem;
    }

    .low-confidence-warning {
        font-size: 0.7rem;
    }
}

/*
 Group Delete Modal Styles */
#groupDeleteModal .modal-content {
    max-width: 600px;
    width: 90%;
}

.warning-message {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.warning-message i {
    color: #856404;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.warning-message h3 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.warning-message p {
    color: #856404;
    margin-bottom: 0;
}

.deletion-details {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.deletion-details h4 {
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.deletion-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.deletion-details li {
    padding: 0.25rem 0;
    color: #6c757d;
}

.deletion-details li i {
    width: 1.25rem;
    margin-right: 0.5rem;
    color: #dc3545;
}

.backup-option {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.backup-option label {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #0c5460;
}

.backup-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

.backup-option small {
    color: #0c5460;
    font-size: 0.875rem;
}

.confirmation-input {
    margin-bottom: 1rem;
}

.confirmation-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.confirmation-input strong {
    color: #dc3545;
    font-family: monospace;
}

.confirmation-input input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ced4da;
    border-radius: 0.375rem;
    font-family: monospace;
    font-size: 1rem;
}

.confirmation-input input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Responsive adjustments for delete modal */
@media (max-width: 768px) {
    #groupDeleteModal .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .deletion-details li {
        font-size: 0.875rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/ * Group Messages Modal Styles */ .large-modal {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.stats-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
}

.stat-item {
    color: #495057;
    font-size: 0.875rem;
}

.stat-item strong {
    color: #212529;
    font-weight: 600;
}

/* Message Filters */
.message-filters {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.filter-input {
    padding: 0.375rem 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.filter-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Messages Container */
.messages-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.messages-list {
    padding: 0;
}

.message-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem;
    background-color: #fff;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.message-sender {
    display: flex;
    flex-direction: column;
}

.message-sender strong {
    color: #495057;
    font-size: 0.9rem;
}

.message-phone {
    color: #6c757d;
    font-size: 0.75rem;
    font-family: monospace;
}

.message-timestamp {
    color: #6c757d;
    font-size: 0.75rem;
    white-space: nowrap;
}

.message-content {
    margin-bottom: 0.5rem;
}

.message-content p {
    margin: 0;
    color: #212529;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
}

.message-type {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.media-type {
    background-color: #e9ecef;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: capitalize;
}

/* Media Content */
.media-content {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.media-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.25rem;
    display: block;
    margin-bottom: 0.5rem;
}

.media-video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.media-audio {
    width: 100%;
    margin-bottom: 0.5rem;
}

.media-document {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.media-document i {
    color: #6c757d;
    font-size: 1.25rem;
}

.media-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.media-link:hover {
    text-decoration: underline;
}

.media-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
}

.media-filename {
    font-weight: 500;
}

.media-size {
    color: #868e96;
}

/* Transcription Content */
.transcription-content {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 0.375rem;
}

.transcription-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1565c0;
}

.transcription-header i {
    color: #1976d2;
}

.confidence-score {
    margin-left: auto;
    font-size: 0.75rem;
    color: #1565c0;
    background-color: #bbdefb;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.transcription-text {
    color: #0d47a1;
    font-style: italic;
    line-height: 1.4;
}

/* No Messages State */
.no-messages {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-messages i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.no-messages p {
    margin: 0;
    font-size: 1.1rem;
}

.message-error {
    text-align: center;
    padding: 2rem 1rem;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 0.375rem;
    margin: 1rem;
}

.message-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#pageInfo {
    color: #495057;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive adjustments for messages modal */
@media (max-width: 768px) {
    .large-modal {
        width: 98%;
        max-height: 95vh;
    }

    .filter-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-group {
        min-width: auto;
    }

    .stats-summary {
        flex-direction: column;
        gap: 0.5rem;
    }

    .message-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .message-timestamp {
        align-self: flex-start;
    }

    .pagination-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pagination-controls {
        width: 100%;
        justify-content: center;
    }

    .media-image,
    .media-video {
        max-height: 200px;
    }
}

/* AWS Aler
ts Section */
.aws-alerts-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.alert-timestamp {
    margin-left: auto;
    font-size: 0.875rem;
    opacity: 0.7;
    font-weight: normal;
}

.alert-message {
    margin-bottom: 0.5rem;
}

.alert-details {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.alert-details ul {
    margin: 0;
    padding-left: 1.5rem;
}

.alert-details li {
    margin-bottom: 0.25rem;
}

/* AWS Status Icons */
.status-icon.warning {
    background-color: #ffc107;
    color: white;
}

.status-icon.disabled {
    background-color: #6c757d;
    color: white;
}

/* AWS Media Processing Statistics */
.stats-grid .stat-card:nth-child(n+7) {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
    color: white;
}

.stats-grid .stat-card:nth-child(n+7) .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive adjustments for AWS metrics */
@media (max-width: 768px) {
    .aws-alerts-section {
        margin: 1rem;
        padding: 1rem;
    }

    .alert-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .alert-timestamp {
        margin-left: 0;
    }
}

/* QR C
ode Section */
.qr-code-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qr-code-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.qr-code-instructions {
    flex: 1;
}

.qr-code-instructions h3 {
    color: #25D366;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qr-code-instructions ol {
    padding-left: 1.5rem;
    line-height: 1.8;
}

.qr-code-instructions li {
    margin-bottom: 0.5rem;
}

.qr-code-display {
    flex: 0 0 300px;
    text-align: center;
}

.qr-code-image {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1rem;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.qr-code-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.qr-placeholder {
    text-align: center;
    color: #6c757d;
}

.qr-placeholder i {
    color: #25D366;
    margin-bottom: 1rem;
}

.qr-code-status {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Status indicators */
.status-connected {
    color: #28a745;
}

.status-disconnected {
    color: #dc3545;
}

.status-connecting {
    color: #ffc107;
}

/* Responsive QR Code */
@media (max-width: 768px) {
    .qr-code-container {
        flex-direction: column;
        gap: 1rem;
    }

    .qr-code-display {
        flex: none;
    }

    .qr-code-image {
        min-height: 200px;
    }
}

/* Loading spinner for QR code */
.qr-code-image .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #25D366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 
Settings Tab Styles */
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: #25D366;
}

/* Resource Status Grid */
.resource-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.resource-status-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.resource-status-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.resource-status-card .resource-icon {
    text-align: center;
    margin-bottom: 15px;
}

.resource-status-card .resource-icon i {
    font-size: 32px;
    color: #6c757d;
}

.resource-status-card .resource-info h4 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.resource-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.status-indicator {
    font-size: 12px;
}

.status-indicator.healthy {
    color: #28a745;
}

.status-indicator.unhealthy {
    color: #dc3545;
}

.status-indicator.degraded {
    color: #ffc107;
}

.status-indicator.checking {
    color: #6c757d;
    animation: pulse 1.5s infinite;
}

.status-text {
    font-weight: 500;
    font-size: 14px;
}

.resource-details {
    text-align: center;
}

.resource-details small {
    font-size: 12px;
}

/* Notification Configuration Cards */
.notification-config-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.config-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-title i {
    font-size: 20px;
    color: #25D366;
}

.config-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.config-toggle {
    display: flex;
    align-items: center;
}

.config-content {
    padding: 20px;
    display: none;
}

.config-content.active {
    display: block;
}

.config-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.config-actions .btn {
    font-size: 14px;
}

/* Settings Form */
#notificationSettingsForm .form-group {
    margin-bottom: 20px;
}

#notificationSettingsForm .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#notificationSettingsForm .form-control:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

#notificationSettingsForm .form-control:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

#notificationSettingsForm label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

#notificationSettingsForm small.text-muted {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    justify-content: flex-end;
}

.settings-actions .btn {
    min-width: 140px;
}

/* Enhanced Toggle Switch for Settings */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.toggle-slider {
    background-color: #25D366;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

input:focus+.toggle-slider {
    box-shadow: 0 0 1px #25D366;
}

/* Status Indicators Animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Alert Styles for Settings */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-success::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-danger::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-warning::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-info::before {
    content: "\f05a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* Loading State for Settings */
#settingsLoading {
    text-align: center;
    padding: 20px;
    color: #666;
}

#settingsLoading .spinner {
    margin: 0 auto 10px;
}

/* Responsive Design for Settings */
@media (max-width: 768px) {
    .resource-status-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .config-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .config-actions {
        flex-direction: column;
    }

    .config-actions .btn {
        width: 100%;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
    }

    .resource-status-card {
        padding: 15px;
    }

    .notification-config-card {
        margin-bottom: 15px;
    }

    .config-header,
    .config-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .settings-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .resource-status-card .resource-icon i {
        font-size: 24px;
    }

    .config-title h4 {
        font-size: 14px;
    }

    .toggle-switch {
        width: 48px;
        height: 24px;
    }

    .toggle-slider:before {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }

    input:checked+.toggle-slider:before {
        transform: translateX(24px);
    }
}

/* Disabled State for Configuration Content */
.config-content:not(.active) {
    opacity: 0.6;
    pointer-events: none;
}

.config-content:not(.active) .form-control {
    background-color: #f8f9fa;
    color: #6c757d;
}

.config-content:not(.active) .btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Enhanced Form Validation for Settings */
.form-group.error .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.form-group.success .form-control {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.success-message {
    color: #28a745;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Test Notification Feedback */
.test-notification-feedback {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
}

.test-notification-feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.test-notification-feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Resource Status Real-time Updates */
.resource-status-card.updating {
    border-color: #25D366;
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.2);
}

.resource-status-card.healthy {
    border-left: 4px solid #28a745;
}

.resource-status-card.unhealthy {
    border-left: 4px solid #dc3545;
}

.resource-status-card.degraded {
    border-left: 4px solid #ffc107;
}

.resource-status-card.checking {
    border-left: 4px solid #6c757d;
}

/* 
Enhanced Form Validation Styles for Settings Tab */
input.error,
select.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

input.success,
select.success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25) !important;
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

/* Modal Dialog Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content {
    padding: 0;
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-body {
    padding: 20px 24px;
}

.modal-body p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer .btn {
    min-width: 80px;
}

/* Resource Status Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.status-indicator {
    transition: all 0.3s ease;
}

.resource-status-card {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.resource-status-card.unhealthy {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
}

.resource-status-card.degraded {
    border-left: 4px solid #ffc107;
}

.resource-status-card.checking {
    border-left: 4px solid #6c757d;
}

/* Alert Enhancements */
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert i {
    font-size: 16px;
}

.alert.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Loading State Enhancements */
.form-control:disabled {
    background-color: #f8f9fa;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Pending Changes Indicator */
.settings-form.has-changes {
    border-left: 4px solid #ffc107;
    padding-left: 16px;
}

.settings-form.has-changes::before {
    content: "⚠️ Alterações não salvas";
    display: block;
    color: #856404;
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

/* ====
= SETTINGS TAB STYLES ===== */

/* Settings Section Layout */
.settings-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: #25D366;
    font-size: 22px;
}

/* Resource Status Grid */
.resource-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.resource-status-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.resource-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #6c757d;
    transition: background-color 0.3s ease;
}

.resource-status-card[data-status="healthy"]::before {
    background: #28a745;
}

.resource-status-card[data-status="unhealthy"]::before {
    background: #dc3545;
}

.resource-status-card[data-status="degraded"]::before {
    background: #ffc107;
}

.resource-status-card[data-status="checking"]::before {
    background: #17a2b8;
    animation: pulse 2s infinite;
}

.resource-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.resource-status-card .resource-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.resource-status-card .resource-icon i {
    font-size: 24px;
    color: #6c757d;
}

.resource-status-card[data-status="healthy"] .resource-icon {
    background: #d4edda;
}

.resource-status-card[data-status="healthy"] .resource-icon i {
    color: #28a745;
}

.resource-status-card[data-status="unhealthy"] .resource-icon {
    background: #f8d7da;
}

.resource-status-card[data-status="unhealthy"] .resource-icon i {
    color: #dc3545;
}

.resource-status-card[data-status="degraded"] .resource-icon {
    background: #fff3cd;
}

.resource-status-card[data-status="degraded"] .resource-icon i {
    color: #ffc107;
}

.resource-status-card[data-status="checking"] .resource-icon {
    background: #d1ecf1;
}

.resource-status-card[data-status="checking"] .resource-icon i {
    color: #17a2b8;
    animation: spin 2s linear infinite;
}

.resource-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.resource-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator i {
    font-size: 12px;
}

.status-indicator.healthy {
    color: #28a745;
}

.status-indicator.unhealthy {
    color: #dc3545;
}

.status-indicator.degraded {
    color: #ffc107;
}

.status-indicator.checking {
    color: #17a2b8;
}

.status-indicator.checking i {
    animation: pulse 1.5s infinite;
}

.resource-details {
    font-size: 12px;
    color: #6c757d;
}

/* Notification Configuration Cards */
.notification-config-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.notification-config-card:hover {
    border-color: #25D366;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.1);
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.config-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-title i {
    font-size: 20px;
    color: #25D366;
}

.config-title h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.config-toggle {
    display: flex;
    align-items: center;
}

.config-content {
    padding: 20px;
    background: white;
    transition: all 0.3s ease;
}

.config-content.disabled {
    opacity: 0.6;
    pointer-events: none;
    background: #f8f9fa;
}

.config-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Form Enhancements for Settings */
.settings-section .form-group {
    margin-bottom: 20px;
}

.settings-section .form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.settings-section .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.settings-section .form-control:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.settings-section .form-control:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.settings-section .form-control.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.settings-section .form-control.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.settings-actions .btn {
    min-width: 150px;
}

/* Loading States */
.settings-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
}

.settings-loading .spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.settings-loading p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Success and Error States */
.settings-section .alert {
    margin: 15px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section .alert i {
    font-size: 16px;
}

.settings-section .alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.settings-section .alert-success i {
    color: #28a745;
}

.settings-section .alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.settings-section .alert-danger i {
    color: #dc3545;
}

.settings-section .alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.settings-section .alert-warning i {
    color: #ffc107;
}

.settings-section .alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.settings-section .alert-info i {
    color: #17a2b8;
}

/* Validation Feedback */
.form-feedback {
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.form-feedback.valid {
    color: #28a745;
}

.form-feedback.invalid {
    color: #dc3545;
}

.form-feedback i {
    margin-right: 5px;
}

/* Button Loading States */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

.btn-secondary.loading::after {
    color: #6c757d;
}

/* Notification Test Results */
.test-result {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInFromTop 0.3s ease;
}

.test-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.test-result i {
    font-size: 14px;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Toggle Switch for Settings */
.settings-section .toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.settings-section .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-section .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 30px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-section .toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-section input:checked+.toggle-slider {
    background-color: #25D366;
}

.settings-section input:checked+.toggle-slider:before {
    transform: translateX(30px);
}

.settings-section input:focus+.toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(37, 211, 102, 0.2);
}

/* Resource Status Animations */
@keyframes healthPulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.resource-status-card[data-status="checking"] {
    animation: healthPulse 2s infinite;
}







/* Settings Tab Styles */
#settingsTab {
    background: #f8f9fa !important;
}

.settings-section {
    background: white !important;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
    color: #333 !important;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.section-header h3 {
    color: #333 !important;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: #25D366;
}

/* Resource Status Grid */
.resource-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.resource-status-card {
    background: white !important;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #333 !important;
}

.resource-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.resource-status-card.healthy {
    border-left: 4px solid #28a745;
}

.resource-status-card.unhealthy {
    border-left: 4px solid #dc3545;
}

.resource-status-card.degraded {
    border-left: 4px solid #ffc107;
}

.resource-status-card.checking {
    border-left: 4px solid #6c757d;
}

.resource-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #f8f9fa;
    color: #25D366;
}

.resource-info {
    flex: 1;
}

.resource-info h4 {
    margin: 0 0 8px 0;
    color: #333 !important;
    font-size: 16px;
    font-weight: 600;
}

.resource-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator.healthy {
    color: #28a745;
}

.status-indicator.unhealthy {
    color: #dc3545;
}

.status-indicator.degraded {
    color: #ffc107;
}

.status-indicator.checking {
    color: #6c757d;
}

.status-text {
    font-size: 14px;
    font-weight: 500;
}

.resource-details {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
}

/* Notification Configuration Cards */
.notification-config-card {
    background: white !important;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #333 !important;
}

.config-header {
    background: #f8f9fa !important;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333 !important;
}

.config-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-title i {
    color: #25D366;
    font-size: 20px;
}

.config-title h4 {
    margin: 0;
    color: #333 !important;
    font-size: 18px;
    font-weight: 600;
}

.config-toggle {
    display: flex;
    align-items: center;
}

.config-content {
    padding: 20px;
    background: white !important;
    display: none;
    color: #333 !important;
}

.config-content.active {
    display: block;
}

.config-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Settings Form Styles */
.settings-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.settings-section .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: white !important;
    color: #333 !important;
}

.settings-section .form-control:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.settings-section .form-control.error {
    border-color: #dc3545;
}

.settings-section .form-control.success {
    border-color: #28a745;
}

.field-error {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #dc3545;
}

/* System Information Grid */
.system-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white !important;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    color: #333 !important;
}

.info-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: #f8f9fa;
    color: #25D366;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content h4 {
    margin: 0 0 10px 0;
    color: #333 !important;
    font-size: 18px;
    font-weight: 600;
}

.info-description {
    margin: 0 0 15px 0;
    color: #555 !important;
    font-size: 14px;
    line-height: 1.5;
}

.info-details {
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.info-details small {
    color: #6c757d !important;
    font-size: 12px;
    line-height: 1.4;
}

/* Settings Messages */
.settings-message {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    animation: slideInFromTop 0.3s ease;
    border: 1px solid;
}

.settings-message.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.settings-message.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.settings-message.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.settings-message.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.settings-message .close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
    opacity: 0.7;
    color: inherit;
}

.settings-message .close:hover {
    opacity: 1;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Settings Text Styles */
.settings-section label {
    color: #333 !important;
    font-weight: 500;
}

.settings-section .text-muted {
    color: #6c757d !important;
}

.settings-section .text-danger {
    color: #dc3545 !important;
}

.settings-section .text-success {
    color: #28a745 !important;
}

.settings-section .text-info {
    color: #17a2b8 !important;
}

.settings-section small {
    color: #6c757d !important;
}

/* Settings Responsive Design */
@media (max-width: 768px) {
    .resource-status-grid {
        grid-template-columns: 1fr;
    }

    .resource-status-card {
        padding: 15px;
    }

    .resource-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .config-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .config-actions {
        flex-direction: column;
    }

    .config-actions .btn {
        width: 100%;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
    }

    .settings-section {
        padding: 20px;
    }

    .system-info-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }

    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin: 0 auto 15px auto;
    }
}



/* Accessibility Improvements */
.resource-status-card:focus-within {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

.form-control:focus {
    outline: none;
}

.toggle-switch input:focus+.toggle-slider {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .resource-status-card {
        border-width: 3px;
    }

    .notification-config-card {
        border-width: 2px;
    }

    .settings-section .form-control {
        border-width: 3px;
    }

    .toggle-slider {
        border: 2px solid #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .resource-status-card,
    .notification-config-card,
    .settings-section .form-control,
    .toggle-slider,
    .toggle-slider:before,
    .btn {
        transition: none;
    }

    .resource-status-card[data-status="checking"],
    .status-indicator.checking i,
    .spinner {
        animation: none;
    }

    .resource-status-card:hover {
        transform: none;
    }
}