/**
 * Notification Flow Admin Styles
 *
 * @package Authyo_OTP_Auth
 * @since 1.0.0
 */

/* Main Container */
.authyo-notification-flow-wrap {
    padding: 0;
}

.authyo-notification-flow-wrap > h1 {
    background: linear-gradient(135deg, #2271b1 0%, #1e5a8a 100%);
    color: #ffffff;
    padding: 24px 32px;
    margin: 0 0 24px 0;
    font-size: 23px;
    font-weight: 600;
    border-radius: 0;
}

/* Header */
.authyo-notification-flow-header {
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid #dcdcde;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.authyo-header-buttons-left,
.authyo-header-buttons-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.authyo-notification-flow-header .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.authyo-notification-flow-header .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.authyo-delete-all-btn {
    color: #d63638 !important;
    border-color: #d63638 !important;
}

.authyo-delete-all-btn:hover {
    background: #d63638 !important;
    color: #ffffff !important;
}

.authyo-popup-large {
    max-width: 900px;
    width: 90%;
}

/* Content Container */
.authyo-notification-flow-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    padding: 0 24px 24px;
}

/* Left Panel - Events */
.authyo-notification-flow-left-panel {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.authyo-panel-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f1;
    color: #1d2327;
}

.authyo-events-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.authyo-event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f6f7f7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.authyo-event-item:hover {
    background: #f0f6fc;
    transform: translateX(4px);
}

.authyo-event-item.active {
    background: #2271b1;
    color: #ffffff;
}

.authyo-event-item.has-flow {
    border-left: 3px solid #00a32a;
}

.authyo-event-item.active.has-flow {
    border-left-color: #ffffff;
}

.authyo-event-name {
    font-weight: 500;
    color: inherit;
}

.authyo-flow-indicator {
    color: #00a32a;
    display: inline-flex;
    align-items: center;
}

.authyo-event-item.active .authyo-flow-indicator {
    color: #ffffff;
}

.authyo-flow-indicator .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.authyo-flow-count {
    background: #2271b1;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.authyo-event-item.active .authyo-flow-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Right Panel - Templates */
.authyo-notification-flow-right-panel {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
}

.authyo-templates-container {
    margin-top: 16px;
}

.authyo-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
}

.authyo-empty-state p {
    margin: 8px 0;
    font-size: 14px;
}

/* Flow Items */
.authyo-flows-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.authyo-flow-item {
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 16px;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.authyo-flow-item:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.authyo-flow-item.authyo-flow-disabled {
    opacity: 0.6;
    background: #f0f0f1;
}

.authyo-flow-item.authyo-flow-disabled .authyo-flow-event,
.authyo-flow-item.authyo-flow-disabled .authyo-flow-methods {
    color: #646970;
}

.authyo-flow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.authyo-flow-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.authyo-flow-event {
    color: #2271b1;
}

.authyo-flow-separator {
    color: #646970;
}

.authyo-flow-method {
    color: #00a32a;
}

.authyo-flow-methods {
    color: #00a32a;
    font-weight: 500;
}

.authyo-flow-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.authyo-edit-flow-btn {
    background: transparent;
    border: none;
    color: #2271b1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.authyo-edit-flow-btn:hover {
    background: #f0f6fc;
    color: #135e96;
}

.authyo-edit-flow-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.authyo-delete-flow-btn {
    background: transparent;
    border: none;
    color: #d63638;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.authyo-delete-flow-btn:hover {
    background: #fcf0f1;
    color: #b32d2e;
}

.authyo-delete-flow-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.authyo-flow-template {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.authyo-template-placeholder,
.authyo-template-name,
.authyo-template-coming-soon {
    color: #646970;
    font-size: 13px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.authyo-template-placeholder strong,
.authyo-template-name strong,
.authyo-template-coming-soon strong {
    color: #1d2327;
    font-weight: 600;
}

.authyo-template-name span {
    color: #2271b1;
    font-weight: 500;
}

.authyo-template-coming-soon span {
    color: #d63638;
    font-weight: 500;
    font-style: italic;
}

/* Popup Styles */
.authyo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.authyo-popup-content {
    background: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.authyo-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #dcdcde;
    flex-shrink: 0;
}

.authyo-popup-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.authyo-popup-close {
    background: transparent;
    border: none;
    color: #646970;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.authyo-popup-close:hover {
    background: #f0f0f1;
    color: #1d2327;
}

.authyo-popup-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.authyo-popup-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.authyo-form-field {
    margin-bottom: 16px;
}

.authyo-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1d2327;
}

.authyo-form-field .required {
    color: #d63638;
}

.authyo-select-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #1d2327;
}

.authyo-select-field:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Accordion Styles */
.authyo-events-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.authyo-event-accordion-item {
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.2s ease;
}

.authyo-event-accordion-item:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.1);
}

.authyo-event-accordion-item.active {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.authyo-event-accordion-header {
    padding: 0;
}

.authyo-event-accordion-content {
    display: none;
    padding: 16px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.authyo-event-accordion-item.active .authyo-event-accordion-content {
    display: block;
}

.authyo-methods-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #1d2327;
    font-size: 13px;
}

/* Checkbox Styles */
.authyo-events-checkbox-group,
.authyo-methods-checkbox-group {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-right: 4px;
}

.authyo-checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #f6f7f7;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.authyo-event-accordion-header .authyo-checkbox-label {
    padding: 12px 16px;
    background: transparent;
    border-radius: 0;
    margin: 0;
}

.authyo-event-accordion-item.active .authyo-event-accordion-header .authyo-checkbox-label {
    background: #f0f6fc;
}

.authyo-checkbox-label:hover {
    background: #f0f6fc;
}

.authyo-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.authyo-checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.authyo-checkbox-label:has(input[type="checkbox"]:disabled) {
    opacity: 0.7;
    cursor: not-allowed;
}

.authyo-checkbox-text {
    flex: 1;
    color: #1d2327;
}

.authyo-checkbox-text strong {
    font-weight: 500;
}

/* Toggle Switch Styles */
.authyo-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin-right: 12px;
    cursor: pointer;
}

.authyo-toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.authyo-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c3c4c7;
    transition: 0.3s;
    border-radius: 24px;
}

.authyo-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.authyo-toggle-switch input:checked + .authyo-toggle-slider {
    background-color: #00a32a;
}

.authyo-toggle-switch input:checked + .authyo-toggle-slider:before {
    transform: translateX(20px);
}

.authyo-toggle-switch input:focus + .authyo-toggle-slider {
    box-shadow: 0 0 0 2px rgba(0, 163, 42, 0.3);
}

.authyo-toggle-switch input:disabled + .authyo-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.authyo-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #dcdcde;
    flex-shrink: 0;
}

.authyo-popup-body .description {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px !important;
    color: #646970;
}

/* Responsive */
@media (max-width: 782px) {
    .authyo-notification-flow-content {
        grid-template-columns: 1fr;
    }
    
    .authyo-notification-flow-left-panel {
        order: 2;
    }
    
    .authyo-notification-flow-right-panel {
        order: 1;
    }
    
    .authyo-popup-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .authyo-popup-header {
        padding: 14px 16px;
    }
    
    .authyo-popup-body {
        padding: 14px 16px;
    }
    
    .authyo-events-checkbox-group,
    .authyo-methods-checkbox-group {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .authyo-event-accordion-content {
        padding: 12px;
    }
}
