/* Frontend Field Styles */
.directorist-single-info__value-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.directorist-single-info__value-wrap .directorist-listing-category-list {
    flex: 1;
    min-width: 150px;
}

/* Field Container */
.bubble-craps-field {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 0;
    width: 100%;
    flex-wrap: wrap;
}

.bubble-craps-value {
    flex: 1;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    min-width: 200px;
    padding-right: 10px;
}

/* Edit Button */
.bubble-craps-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #CD373A;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(205, 55, 58, 0.2);
    white-space: nowrap;
    margin-left: auto;
}

.bubble-craps-edit-btn:hover {
    background: #0C266D;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(12, 38, 109, 0.2);
}

.bubble-craps-edit-btn svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.bubble-craps-edit-btn.pending {
    opacity: 0.7;
    cursor: not-allowed;
    background: #888;
}

/* Edit Interface */
.bubble-craps-edit-interface {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 300px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(12, 38, 109, 0.1);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Controls */
.bubble-craps-edit-select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(12, 38, 109, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    background: white;
}

.bubble-craps-edit-select:focus {
    border-color: #CD373A;
    outline: none;
    box-shadow: 0 0 0 3px rgba(205, 55, 58, 0.1);
}

.bubble-craps-checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(12, 38, 109, 0.2);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 16px;
    background: white;
}

.bubble-craps-checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 10px;
    transition: background-color 0.2s ease;
}

.bubble-craps-checkbox-item:hover {
    background-color: rgba(12, 38, 109, 0.05);
}

.bubble-craps-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(12, 38, 109, 0.3);
    border-radius: 4px;
    cursor: pointer;
}

/* Action Buttons */
.bubble-craps-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.bubble-craps-save-btn,
.bubble-craps-cancel-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
}

.bubble-craps-save-btn {
    background: #CD373A;
    color: white;
}

.bubble-craps-save-btn:hover {
    background: #b62d30;
}

.bubble-craps-save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bubble-craps-cancel-btn {
    background: #f0f2f5;
    color: #0C266D;
}

.bubble-craps-cancel-btn:hover {
    background: #e4e6ea;
}

/* Pending State */
.bubble-craps-pending {
    font-size: 13px;
    color: #CD373A;
    background: rgba(205, 55, 58, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    margin-top: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bubble-craps-pending-label {
    font-weight: 600;
    white-space: nowrap;
}

/* Loading State */
.bubble-craps-loading {
    position: relative;
    color: transparent !important;
}

.bubble-craps-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.bubble-craps-empty {
    color: #666;
    font-style: italic;
}

/* Honeypot Field */
.honeypot-field {
    display: none !important;
}

/* Directorist Integration Styles */
.directorist-single-listing-widget .bubble-craps-field {
    margin-top: 4px;
}

.directorist-single-info__value .bubble-craps-field {
    display: flex;
    vertical-align: middle;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .bubble-craps-field {
        flex-direction: column;
        gap: 8px;
    }

    .bubble-craps-value {
        padding-right: 0;
        width: 100%;
    }

    .bubble-craps-edit-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .bubble-craps-edit-interface {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 32px);
        max-width: 300px;
        margin: 0;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

    .bubble-craps-pending {
        font-size: 12px;
        padding: 8px;
        margin-top: 4px;
        flex-wrap: wrap;
    }

    .bubble-craps-pending-label {
        margin-right: 4px;
    }

    /* Improve touch targets */
    .bubble-craps-checkbox-item {
        padding: 12px 8px;
    }

    .bubble-craps-edit-select,
    .bubble-craps-save-btn,
    .bubble-craps-cancel-btn {
        padding: 12px;
        font-size: 16px; /* Better for touch */
    }

    /* Make checkboxes more touch-friendly */
    .bubble-craps-checkbox-item input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    /* Add modal backdrop */
    .bubble-craps-edit-interface::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    /* Improve edit button responsiveness */
    .bubble-craps-edit-btn {
        height: 40px; /* Larger touch target */
    }

    .bubble-craps-edit-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .bubble-craps-edit-interface {
        width: calc(100% - 24px);
        padding: 12px;
    }

    .bubble-craps-pending {
        text-align: center;
    }

    .bubble-craps-edit-actions {
        flex-direction: column;
        gap: 8px;
    }
}